Package org.apache.derby.iapi.store.access

Examples of org.apache.derby.iapi.store.access.TransactionController


                SanityManager.THROWASSERT("Nested transaction active!");
            }
        }

    // now commit the Store transaction
    TransactionController tc = getTransactionExecute();
    if ( tc != null && commitStore )
    {
      if (sync)
      {
        if (commitflag == NON_XA)
        {
          // regular commit
          tc.commit();
        }
        else
        {
          // This may be a xa_commit, check overloaded commitflag.

          if (SanityManager.DEBUG)
            SanityManager.ASSERT(commitflag == XA_ONE_PHASE ||
                       commitflag == XA_TWO_PHASE,
                         "invalid commit flag");

          ((XATransactionController)tc).xa_commit(commitflag == XA_ONE_PHASE);

        }
      }
      else
      {
        tc.commitNoSync(commitflag);
      }

      // reset the savepoints to the new
      // location, since any outer nesting
      // levels expect there to be a savepoint
View Full Code Here


            readOnlyNestedTransaction = null;
            queryNestingDepth = 0;
        }

    // now rollback the Store transaction
    TransactionController tc = getTransactionExecute();
    if (tc != null)
    { 
      if (xa)
        ((XATransactionController)tc).xa_rollback();
      else
        tc.abort();
           
      // reset the savepoints to the new
      // location, since any outer nesting
      // levels expet there to be a savepoint
      resetSavepoints();
View Full Code Here

   */
  public void internalRollbackToSavepoint( String savepointName, boolean refreshStyle, Object kindOfSavepoint )
    throws StandardException
  {
    // now rollback the Store transaction to the savepoint
    TransactionController tc = getTransactionExecute();
    if (tc != null)
    {
      boolean    closeConglomerates;

      if ( refreshStyle )
      {
        closeConglomerates = true;
        // bug 5145 - don't forget to close the activations while rolling
        // back to a savepoint
        endTransactionActivationHandling(true);
      }
      else { closeConglomerates = false; }

      currentSavepointLevel = tc.rollbackToSavePoint( savepointName, closeConglomerates, kindOfSavepoint );
    }

    if (tc != null && refreshStyle && allDeclaredGlobalTempTables != null)
      tempTablesAndRollback();
  }
View Full Code Here

    @exception StandardException thrown if something goes wrong
   */
  public  void  releaseSavePoint( String savepointName, Object kindOfSavepoint throws StandardException
  {
    TransactionController tc = getTransactionExecute();
    if (tc != null)
    {
      currentSavepointLevel = tc.releaseSavePoint( savepointName, kindOfSavepoint );
      //after a release of a savepoint, we need to go through our temp tables list.
      if (allDeclaredGlobalTempTables != null)
        tempTablesReleaseSavepointLevels();
    }
  }
View Full Code Here

    @exception StandardException thrown if something goes wrong
    */
  public  void  languageSetSavePoint( String savepointName, Object kindOfSavepoint throws StandardException
  {
    TransactionController tc = getTransactionExecute();
    if (tc != null)
    {
      currentSavepointLevel = tc.setSavePoint( savepointName, kindOfSavepoint );
    }
  }
View Full Code Here

    /* Commit and set to new isolation level.
     * NOTE: We commit first in case there's some kind
     * of error, like can't commit within a server side jdbc call.
     */
    TransactionController tc = getTransactionExecute();
    if (!tc.isIdle())
    {
      // If this transaction is in progress, commit it.
      // However, do not allow commit to happen if this is a global
      // transaction.
      if (tc.isGlobal())
        throw StandardException.newException(SQLState.LANG_NO_SET_TRAN_ISO_IN_GLOBAL_CONNECTION);

      userCommit();
    }
    this.isolationLevel = isolationLevel;
View Full Code Here

    return (Activation)acts.get(acts.size() - 1);
  }

  public StringBuffer appendErrorInfo() {

    TransactionController tc = getTransactionExecute();
    if (tc == null)
      return null;

    StringBuffer sb = new StringBuffer(200);

    sb.append(LanguageConnectionContext.xidStr);
    sb.append(tc.getTransactionIdString());
    sb.append("), ");

    sb.append(LanguageConnectionContext.lccStr);
    sb.append(Integer.toString(getInstanceNumber()));
    sb.append("), ");
View Full Code Here

    // Need a TransactionController to get database/service wide properties.
    AccessFactory af = (AccessFactory)
      Monitor.getServiceModule(dataFactory, AccessFactory.MODULE);

    // RESOLVE: sku defectid 2014
    TransactionController tc =
            (af == null) ?
                null :
                af.getTransaction(
                        ContextService.getFactory().getCurrentContextManager());
View Full Code Here

   * @return a property string value.
   **/
  public String getProperty(String key) {

    String propertyValue = null;
    TransactionController tc = null;

    try {

      if (store != null)
          {
            tc = store.getTransaction(
                ContextService.getFactory().getCurrentContextManager());
          }

      propertyValue =
      PropertyUtil.getServiceProperty(tc,
                      key,
                      (String) null);
      if (tc != null) {
      tc.commit();
      tc = null;
      }

    } catch (StandardException se) {
      // Do nothing and just return
View Full Code Here

  }

  public String getDatabaseProperty(String key) {

    String propertyValue = null;
    TransactionController tc = null;

    try {

      if (store != null)
      tc = store.getTransaction(
                ContextService.getFactory().getCurrentContextManager());

      propertyValue =
      PropertyUtil.getDatabaseProperty(tc, key);

      if (tc != null) {
      tc.commit();
      tc = null;
      }

    } catch (StandardException se) {
      // Do nothing and just return
View Full Code Here

TOP

Related Classes of org.apache.derby.iapi.store.access.TransactionController

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.