Package org.apache.derby.iapi.sql.conn

Examples of org.apache.derby.iapi.sql.conn.LanguageConnectionContext


    {
      //Inplace compress let's the user call compress on VTI but it
      //is really a no-op. In order to avoid having to go throught
      //the ALTER TABLE code just for a no-op, we simply do the check
      //here and return if we are dealing with VTI.
    LanguageConnectionContext lcc       = ConnectionUtil.getCurrentLCC();
    TransactionController     tc        = lcc.getTransactionExecute();

    try
        {
            DataDictionary data_dictionary = lcc.getDataDictionary();
            SchemaDescriptor sd =
                data_dictionary.getSchemaDescriptor(schema, tc, true);
            TableDescriptor  td =
                data_dictionary.getTableDescriptor(tablename, sd, tc);
View Full Code Here


  public static void INSTALL_JAR(String url, String jar, int deploy)
    throws SQLException {

    try {
           
            LanguageConnectionContext lcc = ConnectionUtil.getCurrentLCC();

      String[] st = IdUtil.parseMultiPartSQLIdentifier(jar.trim());

      String schemaName;
      String sqlName;
           
            if (st.length == 1)
            {
        schemaName = lcc.getCurrentSchemaName();
        sqlName = st[0];
            }
            else
            {
                schemaName = st[0];
View Full Code Here

  public static void REPLACE_JAR(String url, String jar)
    throws SQLException {

    try {
           
            LanguageConnectionContext lcc = ConnectionUtil.getCurrentLCC();

      String[] st = IdUtil.parseMultiPartSQLIdentifier(jar.trim());

            String schemaName;
            String sqlName;
           
            if (st.length == 1)
            {
                schemaName = lcc.getCurrentSchemaName();
                sqlName = st[0];
            }
            else
            {
                schemaName = st[0];
View Full Code Here

  public static void REMOVE_JAR(String jar, int undeploy)
    throws SQLException {

    try {
           
            LanguageConnectionContext lcc = ConnectionUtil.getCurrentLCC();

      String[] st = IdUtil.parseMultiPartSQLIdentifier(jar.trim());

            String schemaName;
            String sqlName;
           
            if (st.length == 1)
            {
                schemaName = lcc.getCurrentSchemaName();
                sqlName = st[0];
            }
            else
            {
                schemaName = st[0];
View Full Code Here

     * collected.
     */
    public static void SYSCS_EMPTY_STATEMENT_CACHE()
       throws SQLException
    {
       LanguageConnectionContext lcc = ConnectionUtil.getCurrentLCC();
      
       CacheManager statementCache =
           lcc.getLanguageConnectionFactory().getStatementCache();
      
       if (statementCache != null)
           statementCache.ageOut();
    }
View Full Code Here

     * @throws SQLException
     */
    public static void SYSCS_SET_XPLAIN_SCHEMA(String schemaName)
                throws SQLException, StandardException
    {
        LanguageConnectionContext lcc       = ConnectionUtil.getCurrentLCC();
        TransactionController     tc        = lcc.getTransactionExecute();

        if (schemaName == null || schemaName.trim().length() == 0)
        {
            lcc.setXplainSchema(null);
            return;
        }

        boolean statsSave = lcc.getRunTimeStatisticsMode();
        lcc.setRunTimeStatisticsMode(false);
        createXplainSchema(schemaName);
        createXplainTable(lcc, schemaName,
                new XPLAINStatementDescriptor());
        createXplainTable(lcc, schemaName,
                new XPLAINStatementTimingsDescriptor());
        createXplainTable(lcc, schemaName,
                new XPLAINResultSetDescriptor());
        createXplainTable(lcc, schemaName,
                new XPLAINResultSetTimingsDescriptor());
        createXplainTable(lcc, schemaName,
                new XPLAINScanPropsDescriptor());
        createXplainTable(lcc, schemaName,
                new XPLAINSortPropsDescriptor());
        lcc.setRunTimeStatisticsMode(statsSave);
        lcc.setXplainSchema(schemaName);
    }
View Full Code Here

     * Make a note that this thread saw an interrupt. Thread's intr
     * status flag is presumably off already, but we reset it here
     * also. Use lcc if available, else thread local variable.
     */
    public static void setInterrupted() {
        LanguageConnectionContext lcc = null;
        try {
            lcc = (LanguageConnectionContext)ContextService.getContextOrNull(
                LanguageConnectionContext.CONTEXT_ID);

        } catch (ShutdownException e) {
            // Ignore. Can happen when: a) background thread (RawStoreDaemon)
            // is performing checkpointing and b) a user thread starts shutdown
            // and interrupts the background thread. During recovery of the
            // container we get here. DERBY-4920.
        }


        Thread.interrupted();

        StandardException e =
            StandardException.newException(SQLState.CONN_INTERRUPT);

        if (lcc != null) {
            lcc.setInterruptedException(e);

        } else {
            exception.set(e);
        }
    }
View Full Code Here

     * <p/>
     * If an interrupt status flag was seen, we set it back <em>on</em> here.
     */
    public static void restoreIntrFlagIfSeen() {

        LanguageConnectionContext lcc = null;
        try {
            lcc =
                (LanguageConnectionContext)ContextService.getContextOrNull(
                    LanguageConnectionContext.CONTEXT_ID);
        } catch (ShutdownException e) {
            // Ignore. DERBY-4911 Restoring interrupt flag is moot anyway if we
            // are closing down.
        }

        if (lcc == null) {
            // no lcc available for this thread, use thread local flag
            if (exception.get() != null) {

                exception.set(null);

                // Set thread's interrupt status flag back on before returning
                // control to user application
                Thread.currentThread().interrupt();
            }

        } else if (lcc.getInterruptedException() != null) {

            lcc.setInterruptedException(null);

            // Set thread's interrupt status flag back on before returning
            // control to user application
            Thread.currentThread().interrupt();
        }
View Full Code Here

     * @param lcc the language connection context for this session
     */
    public static void restoreIntrFlagIfSeen(LanguageConnectionContext lcc) {

        if (SanityManager.DEBUG) {
            LanguageConnectionContext ctxLcc = null;
            try {
                ctxLcc = (LanguageConnectionContext)ContextService.
                    getContextOrNull(LanguageConnectionContext.CONTEXT_ID);

                SanityManager.ASSERT(
View Full Code Here

            throws StandardException
  {
    TableDescriptor td;
    ConglomerateDescriptor cd;

    LanguageConnectionContext lcc = activation.getLanguageConnectionContext();
    DataDictionary dd = lcc.getDataDictionary();
    TransactionController tc = lcc.getTransactionExecute();

    /*
    ** Inform the data dictionary that we are about to write to it.
    ** There are several calls to data dictionary "get" methods here
    ** that might be done in "read" mode in the data dictionary, but
View Full Code Here

TOP

Related Classes of org.apache.derby.iapi.sql.conn.LanguageConnectionContext

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.