Package org.apache.derby.iapi.store.raw.xact

Examples of org.apache.derby.iapi.store.raw.xact.RawTransaction


        throw StandardException.newException(
                        SQLState.DATA_UNDELETE_RECORD);
            }
    }

    RawTransaction t = owner.getTransaction();

    // logical operations not allowed in internal transactions.
    if (undo != null) {
      t.checkLogicalOperationOk();
    }

    RecordHandle handle = getRecordHandleAtSlot(slot);

    owner.getActionSet().actionDelete(t, this, slot, handle.getId(), delete, undo);
View Full Code Here


      throw StandardException.newException(
                    SQLState.DATA_SLOT_NOT_ON_PAGE);
        }

    RawTransaction t = owner.getTransaction();

    // lock the records to be purged
    int[] recordIds = new int[numpurges];

    PageKey pageId = getPageId(); // RESOLVE: MT problem ?
View Full Code Here

                    dpage.getPageId().getContainerId());
        }

    int[] recordIds = new int[num_rows];

    RawTransaction t = owner.getTransaction();

    // lock the records to be purged and calculate total space needed
    for (int i = 0; i < num_rows; i++)
    {
      RecordHandle handle = getRecordHandleAtSlot(src_slot+i);
View Full Code Here

    @exception StandardException Standard Derby policy.
  */
  void setExclusive(BaseContainerHandle requester)
    throws StandardException {

    RawTransaction t = requester.getTransaction();

    // In some cases latches are held until after a commit or an abort
    // (currently internal and nested top transactions.
    // If this is the case then during an abort a latch
    // request will be made for a latch that is already held.
    // We do not allow the latch to be obtained multiple times
    // because i) latches are exclusive for simplicity and
    // performance, ii) holding a page latched means that the page is
    // on the container handle's obervers list, if we latched it twice
    // then the paeg would have to be on the list twice, which is not supported
    // since the page has value equality. To be on the list twice reference
    // equality would be required, which would mean pushing a ReferenceObservable
    // object for every latch; iii) other unknown reasons :-)
    synchronized (this)
    {
      // need synchronized block because owner may be set to null in the
      // middle if another thread is in the process of unlatching the
      // page
      if ((owner != null) && (t == owner.getTransaction())) {

        if (t.inAbort()) {
          //
          nestedLatch++;
          return;
        }

View Full Code Here

    <BR>
    MT - thread safe
  */
  boolean setExclusiveNoWait(BaseContainerHandle requester) throws StandardException {

    RawTransaction t = requester.getTransaction();

    // comment in setExclusive()
    synchronized (this)
    {
      if ((owner != null) && (t == owner.getTransaction())) {

        if (t.inAbort()) {
          //
          nestedLatch++;
          return true;
        }
      }
View Full Code Here

        {
      throw StandardException.newException(
                    SQLState.DATA_CONTAINER_READ_ONLY);
        }

    RawTransaction t = owner.getTransaction();

    owner.getActionSet().actionInvalidatePage(t, this);
  }
View Full Code Here

        {
      throw StandardException.newException(
                    SQLState.DATA_CONTAINER_READ_ONLY);
        }

    RawTransaction t = owner.getTransaction();

    owner.getActionSet().actionInitPage(
      t, this, initFlag, getTypeFormatId(), pageOffset);
  }
View Full Code Here

        {
      throw StandardException.newException(
                    SQLState.DATA_SLOT_NOT_ON_PAGE);
        }

    RawTransaction t = owner.getTransaction();

    // get num_rows row locks, need to predict what those recordIds will be

    int[] recordIds = new int[num_rows];
View Full Code Here

        if (ttab.findTransactionContextByGlobalId(gid) != null)
        {
            throw StandardException.newException(SQLState.STORE_XA_XAER_DUPID);
        }

        RawTransaction xact =
            startCommonTransaction(
                rsf, cm, false, null,
                USER_CONTEXT_ID, AccessFactoryGlobals.USER_TRANS_NAME, true);

        xact.setTransactionId(gid, xact.getId());

        return(xact);
  }
View Full Code Here

    int irbcount = 0;

    // First undo internal transactions if there is any
    if (ttab.hasRollbackFirstTransaction())
    {
      RawTransaction internalTransaction = startInternalTransaction(rsf,
        recoveryTransaction.getContextManager());

      // make this transaction be aware that it is being used by recovery
      internalTransaction.recoveryTransaction();

      if (SanityManager.DEBUG)
        SanityManager.ASSERT(
                    internalTransaction.handlesPostTerminationWork() == false,
                    "internal recovery xact handles post termination work");

      while(ttab.getMostRecentRollbackFirstTransaction(
                                                internalTransaction))
      {
        irbcount++;
        internalTransaction.abort();
      }

      internalTransaction.close();
    }

    if (SanityManager.DEBUG)
    {
      SanityManager.ASSERT(
View Full Code Here

TOP

Related Classes of org.apache.derby.iapi.store.raw.xact.RawTransaction

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.