Examples of TransactionController


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

    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

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

    ExecRow            template;

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

    /* Mark the activation as being for create table */
    activation.setForCreateTable();

        // setup for create conglomerate call:
        //   o create row template to tell the store what type of rows this
        //     table holds.
        //   o create array of collation id's to tell collation id of each
        //     column in table.
    template            = RowUtil.getEmptyValueRow(columnInfo.length, lcc);
        int[] collation_ids = new int[columnInfo.length];

    for (int ix = 0; ix < columnInfo.length; ix++)
    {
            ColumnInfo  col_info = columnInfo[ix];

            // Get a template value for each column

      if (col_info.defaultValue != null)
            {
                /* If there is a default value, use it, otherwise use null */
        template.setColumn(ix + 1, col_info.defaultValue);
            }
      else
            {
        template.setColumn(ix + 1, col_info.dataType.getNull());
            }

            // get collation info for each column.

            collation_ids[ix] = col_info.dataType.getCollationType();
    }


    /* create the conglomerate to hold the table's rows
     * RESOLVE - If we ever have a conglomerate creator
     * that lets us specify the conglomerate number then
     * we will need to handle it here.
     */
    long conglomId = tc.createConglomerate(
        "heap", // we're requesting a heap conglomerate
        template.getRowArray(), // row template
        null, //column sort order - not required for heap
                collation_ids,
        properties, // properties
View Full Code Here

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

    boolean          inOrder = (order.length == 0 || isInSortedOrder);
    int            inputRowCountEstimate = (int) optimizerEstimatedRowCount;

    // find the language context and
        // Get the current transaction controller
    TransactionController tc = getTransactionController();
    sortId = tc.createSort((Properties)null,
            sortTemplateRow.getRowArray(),
            order,
            observer,
            inOrder,
            inputRowCountEstimate, // est rows
             maxRowSize      // est rowsize
            );
    sorter = tc.openSort(sortId);
    genericSortId = sortId;
    dropGenericSort = true;
 
    /* The sorter is responsible for doing the cloning */
    while ((inputRow = getNextRowFromRS()) != null)
    {
      /* The sorter is responsible for doing the cloning */
      sorter.insert(inputRow.getRowArray());
    }
    source.close();
    sortProperties = sorter.getSortInfo().getAllSortInfo(sortProperties);
    sorter.completedInserts();

    return tc.openSortScan(sortId, activation.getResultSetHoldability());
  }
View Full Code Here

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

    {
        SanityManager.ASSERT(!isOpen, "LastIndexKeyResultSet already open");
    }

    isOpen = true;
    TransactionController tc = activation.getTransactionController();

    initIsolationLevel();

    /*
    ** Grab the last row.  Note that if there are deletes
    ** left lying around and no real row to return, then
    ** the row array gets set even though the scan doesn't
    ** return a row, so be careful to handle this correctly.
    */
    if (tc.fetchMaxOnBtree(
          conglomId,  // conglomerate to open
          0,       // open mode
          lockMode,
          isolationLevel,
          accessedCols,
View Full Code Here

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

  {
    SortController       sorter;
    ExecRow         sourceRow;
    int            inputRowCountEstimate = (int) optimizerEstimatedRowCount;

    TransactionController tc = getTransactionController();

    /*
    ** We have a distinct aggregate so, we'll need
    ** to do a sort.  We use all of the sorting columns and
    ** drop the aggregation on the distinct column.  Then
    ** we'll feed this into the sorter again w/o the distinct
    ** column in the ordering list.
    */
    GenericAggregator[] aggsNoDistinct = getSortAggregators(aggInfoList, true,
        activation.getLanguageConnectionContext(), source);
    SortObserver sortObserver = new AggregateSortObserver(true, aggsNoDistinct, aggregates,
                                sortTemplateRow);

    sortId = tc.createSort((Properties)null,
          sortTemplateRow.getRowArray(),
          order,
          sortObserver,
          false,      // not in order
          inputRowCountEstimate,        // est rows, -1 means no idea 
          maxRowSize    // est rowsize
          );
    sorter = tc.openSort(sortId);
    dropDistinctAggSort = true;
       
    while ((sourceRow = source.getNextRowCore())!=null)
    {
      sorter.insert(sourceRow.getRowArray());
      rowsInput++;
    }

    /*
    ** End the sort and open up the result set
    */
    sorter.completedInserts();

    scanController =
            tc.openSortScan(sortId, activation.getResultSetHoldability());
     
    /*
    ** Aggs are initialized and input rows
    ** are in order.
    */ 
 
View Full Code Here

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

    }

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

    cf = lcc.getLanguageConnectionFactory().getClassFactory();

    /* Remember whether or not we are doing a create table */
    forCreateTable = activation.getForCreateTable();
View Full Code Here

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

    LanguageConnectionContext lcc = (LanguageConnectionContext)
      ContextService.getContext(LanguageConnectionContext.CONTEXT_ID);

    TableNameInfo tabInfo = null;
    TransactionInfo[] tt = null;
    TransactionController tc = null;

    if (lcc != null) {

      try {
        tc = lcc.getTransactionExecute();
        tabInfo = new TableNameInfo(lcc, false);

        tt = tc.getAccessManager().getTransactionInfo();

      } catch (StandardException se) {
        // just don't get any table info.
      }
    }


    StringBuffer sb = new StringBuffer(200);

    Hashtable attributes = new Hashtable(17);

    String victimXID = null;

    for (int i = 0; i < chain.size(); i++) {
      Object space = chain.elementAt(i);
      if (space instanceof List) {
        List grants = (List) space;

        if (grants.size() != 0) {

          sb.append("  Granted XID : ");

          for (int j = 0; j < grants.size(); j ++) {

            if (j != 0)
              sb.append(", ");

            Lock gl = (Lock) grants.get(j);

            sb.append("{");
            sb.append(gl.getCompatabilitySpace().getOwner());
            sb.append(", ");
            sb.append(gl.getQualifier());
            sb.append("} ");
          }
          sb.append('\n');
        }
        continue;
      }
      // Information about the lock we are waiting on
      // TYPE |TABLENAME                     |LOCKNAME
      Lock lock = ((Lock) waiters.get(space));
     
      // see if this lockable object wants to participate
      lock.getLockable().lockAttributes(VirtualLockTable.ALL, attributes);

      addInfo(sb, "Lock : ", attributes.get(VirtualLockTable.LOCKTYPE));
      if (tabInfo != null) {
        Long conglomId = (Long) attributes.get(VirtualLockTable.CONGLOMID);
        if (conglomId == null) {
          Long containerId = (Long) attributes.get(VirtualLockTable.CONTAINERID);
          try {
            conglomId = new Long(tc.findConglomid(containerId.longValue()));
          } catch (StandardException se) {
          }
        }
        addInfo(sb, ", ", tabInfo.getTableName(conglomId));
      }
View Full Code Here

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

   *
   * @exception StandardException thrown if cursor finished.
     */
  public void  openCore() throws StandardException
  {
      TransactionController tc;

    beginTime = getCurrentTimeMillis();

    // source expected to be non-null, mystery stress test bug
    // - sometimes get NullPointerException in openCore().
View Full Code Here

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

   *
   * @exception StandardException thrown on failure to open
     */
  public void  openCore() throws StandardException
  {
      TransactionController tc;

    beginTime = getCurrentTimeMillis();
    if (SanityManager.DEBUG)
        SanityManager.ASSERT( ! isOpen, "HashScanResultSet already open");

        // Get the current transaction controller
        tc = activation.getTransactionController();

    initIsolationLevel();

    if (startKeyGetter != null)
    {
      startPosition = (ExecIndexRow) startKeyGetter.invoke(activation);
      if (sameStartStopPosition)
      {
        stopPosition = startPosition;
      }
    }
    if (stopKeyGetter != null)
    {
      stopPosition = (ExecIndexRow) stopKeyGetter.invoke(activation);
    }

    // Check whether there are any comparisons with unordered nulls
    // on either the start or stop position.  If there are, we can
    // (and must) skip the scan, because no rows can qualify
    if (skipScan(startPosition, stopPosition))
    {
      // Do nothing
      ;
    }
    else if (! hashtableBuilt)
    {
      DataValueDescriptor[] startPositionRow =
                startPosition == null ? null : startPosition.getRowArray();
      DataValueDescriptor[] stopPositionRow =
                stopPosition == null ? null : stopPosition.getRowArray();

            hashtable =
                tc.createBackingStoreHashtableFromScan(
                    conglomId,          // conglomerate to open
                    (forUpdate ? TransactionController.OPENMODE_FORUPDATE : 0),
                    lockMode,
                    isolationLevel,
                    accessedCols,
View Full Code Here

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

   * reopen this ResultSet.
   *
   * @exception StandardException thrown if cursor finished.
   */
  public void  reopenCore() throws StandardException {
    TransactionController    tc;

    if (SanityManager.DEBUG)
    {
      SanityManager.ASSERT(isOpen,
          "HashScanResultSet already open");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.