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

Examples of org.apache.derby.iapi.store.raw.Transaction


    {
        // need to open the container and update the row containing the
        // serialized format of the heap. 
        ContainerHandle container = null;
        Page            page      = null;
        Transaction     rawtran   = xact_manager.getRawStoreXact();

        try
        {
            container =
                rawtran.openContainer(
                    id,
                    rawtran.newLockingPolicy(
                        LockingPolicy.MODE_CONTAINER,
                        TransactionController.ISOLATION_SERIALIZABLE, true),
                    ContainerHandle.MODE_FORUPDATE |
                        (isTemporary() ? ContainerHandle.MODE_TEMP_IS_KEPT : 0));
View Full Code Here


     throws StandardException
  {
    if (work == null)
      return Serviceable.DONE;

    Transaction tran =
            rawStoreFactory.findUserTransaction(
                contextMgr, AccessFactoryGlobals.SYS_TRANS_NAME);

    if (SanityManager.DEBUG)
    {
View Full Code Here

    {
      Enumeration e = mergeRuns.elements();

      try
      {
        Transaction rawTran = tran.getRawStoreXact();
        long segmentId = StreamContainerHandle.TEMPORARY_SEGMENT;

        while (e.hasMoreElements())
        {
          long containerId = ((Long) e.nextElement()).longValue();
          rawTran.dropStreamContainer(segmentId, containerId);
        }
      }
      catch (StandardException se)
      {
        // Ignore problems with dropping, worst case
View Full Code Here

            }

      // Create and open another temporary stream conglomerate
      // which will become
      // a merge run made up with the merged runs from the subset.
      Transaction rawTran = tran.getRawStoreXact();
      int segmentId = StreamContainerHandle.TEMPORARY_SEGMENT;
      long id = rawTran.addAndLoadStreamContainer(segmentId,
        properties, msRowSource);

      mergeRuns.addElement(new Long(id));

      // Drop the conglomerates in the merge subset
      e = subset.elements();
      while (e.hasMoreElements())
      {
        Long containerId = (Long) e.nextElement();
        rawTran.dropStreamContainer(segmentId, containerId.longValue());
      }
    }
  }
View Full Code Here

    // TransactionManager.
    SortBufferRowSource rowSource =
      new SortBufferRowSource(sortBuffer, (TransactionManager)null, sortObserver, true, sortBufferMax);

    // Create a temporary stream conglomerate...
    Transaction rawTran = tran.getRawStoreXact()// get raw transaction
    int segmentId = StreamContainerHandle.TEMPORARY_SEGMENT;
    long id = rawTran.addAndLoadStreamContainer(segmentId,
      properties, rowSource);

    // Don't close the sortBuffer, we just emptied it, the caller may reuse
    // that sortBuffer for the next run.
    rowSource = null;
View Full Code Here

    while (e.hasMoreElements())
    {
      // get the container id
      long id = ((Long) e.nextElement()).longValue();

      Transaction rawTran = tran.getRawStoreXact()// get raw transaction
      int segmentId = StreamContainerHandle.TEMPORARY_SEGMENT;
      openScans[scanindex++] =
                rawTran.openStreamContainer(segmentId, id, hold);
    }

    // Load the initial rows.
    for (scanindex = 0; scanindex < openScans.length; scanindex++)
      mergeARow(scanindex);
View Full Code Here

     throws StandardException
  {
    if (work == null)
      return Serviceable.DONE;

    Transaction tran =
            rawStoreFactory.findUserTransaction(
                contextMgr, AccessFactoryGlobals.SYS_TRANS_NAME);

    if (SanityManager.DEBUG)
    {
View Full Code Here

    ContextManager  cm,
    Xid             xid,
    boolean         onePhase)
    throws StandardException
    {
        Transaction rawtran =
            rsf.findUserTransaction(cm, AccessFactoryGlobals.USER_TRANS_NAME);

        // This may happen if somehow the transaction was committed between
        // the find() call and now.
        if (rawtran == null)
        {
            throw StandardException.newException(
                    SQLState.STORE_XA_PROTOCOL_VIOLATION);
        }

        if (SanityManager.DEBUG)
        {
            SanityManager.ASSERT(rawtran != null);

            SanityManager.ASSERT(
                (new GlobalXactId(
                    xid.getFormatId(),
                    xid.getGlobalTransactionId(),
                    xid.getBranchQualifier())).equals(rawtran.getGlobalId()));
        }

        rawtran.xa_commit(onePhase);
    }
View Full Code Here

    public void forget(
    ContextManager  cm,
    Xid             xid)
    throws StandardException
    {
        Transaction rawtran =
            rsf.findUserTransaction(cm, AccessFactoryGlobals.USER_TRANS_NAME);

        if (SanityManager.DEBUG)
        {
            SanityManager.ASSERT(
                new GlobalXactId(
                    xid.getFormatId(),
                    xid.getGlobalTransactionId(),
                    xid.getBranchQualifier()).equals(rawtran.getGlobalId()));
        }

        // forget should only be called on heuristically completed xacts, which
        // should not exist in our system.
        throw StandardException.newException(
View Full Code Here

    public void rollback(
    ContextManager  cm,
    Xid             xid)
        throws StandardException
    {
        Transaction rawtran =
            rsf.findUserTransaction(cm, AccessFactoryGlobals.USER_TRANS_NAME);

        // This may happen if somehow the transaction was committed between
        // the find() call and now.
        if (rawtran == null)
        {
            throw StandardException.newException(
                    SQLState.STORE_XA_PROTOCOL_VIOLATION);
        }

        if (SanityManager.DEBUG)
        {

            SanityManager.ASSERT(
                new GlobalXactId(
                    xid.getFormatId(),
                    xid.getGlobalTransactionId(),
                    xid.getBranchQualifier()).equals(rawtran.getGlobalId()));
        }

        rawtran.xa_rollback();
    }
View Full Code Here

TOP

Related Classes of org.apache.derby.iapi.store.raw.Transaction

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.