Examples of TransactionController


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

            }
    }
     
    if (!conglomCreated)
    {
      TransactionController tc = activation.getTransactionController();

            // TODO-COLLATE, I think collation needs to get set always correctly
            // but did see what to get collate id when there was no result
            // description.  The problem comes if row holder is used to stream
            // row to temp disk, then row is read from disk using an interface
            // where store creates the DataValueDescriptor template itself,
            // and subsquently the returned column is used for some sort of
            // comparison.  Also could be a problem is reader of tempoary
            // table uses qualifiers, that would result in comparisons internal
            // to store.  I believe the below impl is incomplete - either
            // it should always be default, or real collate_ids should be
            // passed in.

            // null collate_ids in createConglomerate call indicates to use all
            // default collate ids.
            int collation_ids[] = null;

            /*
            TODO-COLLATE - if we could count on resultDescription I think the
            following would work.

            if (resultDescription != null)
            {
                // init collation id info from resultDescription for create call
                collation_ids = new int[resultDescription.getColumnCount()];

                for (int i = 0; i < collation_ids.length; i++)
                {
                    collation_ids[i] =
                        resultDescription.getColumnDescriptor(
                            i + 1).getType().getCollationType();
                }
            }
            */


      /*
      ** Create the conglomerate with the template row.
      */
      CID =
                tc.createConglomerate(
                    "heap",
                    inputRow.getRowArray(),
                    null, //column sort order - not required for heap
                    collation_ids,
                    properties,
                    TransactionController.IS_TEMPORARY |
                    TransactionController.IS_KEPT);

      conglomCreated = true;

      cc = tc.openConglomerate(CID,
                                false,
                                TransactionController.OPENMODE_FORUPDATE,
                                TransactionController.MODE_TABLE,
                                TransactionController.ISOLATION_SERIALIZABLE);
      if(isUniqueStream)
View Full Code Here

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

      baseRowLocation =
        (RowLocation) (rlColumn).getObject();
   
      if(!uniqueIndexCreated)
      {
        TransactionController tc =
          activation.getTransactionController();
        int numKeys = 2;
        uniqueIndexRow = new DataValueDescriptor[numKeys];
        uniqueIndexRow[0] = baseRowLocation;
        uniqueIndexRow[1] = baseRowLocation;
        Properties props = makeIndexProperties(uniqueIndexRow, CID);
        uniqueIndexConglomId =
          tc.createConglomerate(
                        "BTREE",
                        uniqueIndexRow,
                        null, 
                        null, // no collation needed for index on row locations.
                        props,
                        (TransactionController.IS_TEMPORARY |
                         TransactionController.IS_KEPT));

        uniqueIndex_cc = tc.openConglomerate(
                uniqueIndexConglomId,
                false,
                TransactionController.OPENMODE_FORUPDATE,
                TransactionController.MODE_TABLE,
                TransactionController.ISOLATION_SERIALIZABLE);
View Full Code Here

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

  private void insertToPositionIndex(int position, RowLocation rl ) throws  StandardException
  {
    if(!positionIndexCreated)
    {
      TransactionController tc = activation.getTransactionController();
      int numKeys = 2;
      position_sqllong = new SQLLongint();
      positionIndexRow = new DataValueDescriptor[numKeys];
      positionIndexRow[0] = position_sqllong;
      positionIndexRow[1] = rl;       
      Properties props = makeIndexProperties(positionIndexRow, CID);
      positionIndexConglomId =
                tc.createConglomerate(
                    "BTREE",
                    positionIndexRow,
                    null, 
                    null, // no collation needed for index on row locations.
                    props,
                    (TransactionController.IS_TEMPORARY |
                     TransactionController.IS_KEPT));

      positionIndex_cc =
                tc.openConglomerate(
                    positionIndexConglomId,
                    false,
                    TransactionController.OPENMODE_FORUPDATE,
                    TransactionController.MODE_TABLE,
                    TransactionController.ISOLATION_SERIALIZABLE);
View Full Code Here

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

   * @return a result set to use
   */
  public CursorResultSet getResultSet()
  {
    state = STATE_DRAIN;
    TransactionController tc = activation.getTransactionController();
    if(isUniqueStream)
    {
      return new TemporaryRowHolderResultSet(tc, rowArray,
                           resultDescription, isVirtualMemHeap,
                           true, positionIndexConglomId, this);
View Full Code Here

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

    {
      positionIndex_cc.close();
      positionIndex_cc = null;
    }

    TransactionController tc = activation.getTransactionController();

    if (uniqueIndexCreated)
    {
      tc.dropConglomerate(uniqueIndexConglomId);
      uniqueIndexCreated = false;
    }

    if (positionIndexCreated)
    {
      tc.dropConglomerate(positionIndexConglomId);
      positionIndexCreated = false;
    }

    if (conglomCreated)
    {
      tc.dropConglomerate(CID);
      conglomCreated = false;
            CID = 0;
    }
        else
        {
View Full Code Here

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

        // Extract/derive information from the table descriptor
        long[] conglomerateNumber = new long[cds.length];
        ExecIndexRow[] indexRow = new ExecIndexRow[cds.length];
        UUID[] objectUUID = new UUID[cds.length];

        TransactionController tc = lcc.getTransactionExecute();
        ConglomerateController heapCC =
            tc.openConglomerate(td.getHeapConglomerateId(), false,
                    0,
                    TransactionController.MODE_RECORD,
                    asBackgroundTask
                        ? TransactionController.ISOLATION_READ_UNCOMMITTED
                        : TransactionController.ISOLATION_REPEATABLE_READ
                );
        try
        {
            for (int i = 0; i < cds.length; i++)
            {
                if (!cds[i].isIndex())
                {
                    conglomerateNumber[i] = -1;
                    continue;
                }

                conglomerateNumber[i] = cds[i].getConglomerateNumber();

                objectUUID[i] = cds[i].getUUID();

                indexRow[i] =
                    cds[i].getIndexDescriptor().getNullIndexRow(
                        td.getColumnDescriptorList(),
                        heapCC.newRowLocationTemplate());
            }
        }
        finally
        {
            heapCC.close();
        }

        // [x][0] = conglomerate number, [x][1] = start time, [x][2] = stop time
        long[][] scanTimes = new long[conglomerateNumber.length][3];
        int sci = 0;
        for (int indexNumber = 0;
             indexNumber < conglomerateNumber.length;
             indexNumber++)
        {
            if (conglomerateNumber[indexNumber] == -1)
                continue;

            // Check if daemon has been disabled.
            if (asBackgroundTask) {
                if (isShuttingDown()) {
                    break;
                }
            }

            scanTimes[sci][0] = conglomerateNumber[indexNumber];
            scanTimes[sci][1] = System.currentTimeMillis();
            // Subtract one for the RowLocation added for indexes.
            int numCols = indexRow[indexNumber].nColumns() - 1;
            long[] cardinality = new long[numCols];
            KeyComparator cmp = new KeyComparator(indexRow[indexNumber]);

            /* Read uncommitted, with record locking. Actually CS store may
               not hold record locks */
            GroupFetchScanController gsc =
                tc.openGroupFetchScan(
                        conglomerateNumber[indexNumber],
                        false,  // hold
                        0,
                        TransactionController.MODE_RECORD, // locking
                        TransactionController.ISOLATION_READ_UNCOMMITTED,
View Full Code Here

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

    private void writeUpdatedStats(LanguageConnectionContext lcc,
                                   TableDescriptor td, UUID index,
                                   long numRows, long[] cardinality,
                                   boolean asBackgroundTask)
            throws StandardException {
        TransactionController tc = lcc.getTransactionExecute();
        trace(1, "writing new stats (xid=" + tc.getTransactionIdString() + ")");
        UUID table = td.getUUID();
        DataDictionary dd = lcc.getDataDictionary();
        UUIDFactory uf = dd.getUUIDFactory();

        // Update the heap row count estimate.
View Full Code Here

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

                        "failed to initialize index statistics updater");
                return;
            }
        }

        TransactionController tc = null;
        try {
            tc = daemonLCC.getTransactionExecute();
            trace(0, "worker thread started (xid=" +
                    tc.getTransactionIdString() + ")");

            TableDescriptor td = null;
            long start = 0;
            while (true) {
                synchronized (queue) {
                    if (daemonDisabled) {
                        // Clean the lcc and exit.
                        try {
                            tc.destroy();
                        } catch (ShutdownException se) {
                            // Ignore
                        }
                        tc = null;
                        daemonLCC = null;
View Full Code Here

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

    try {
    Authorizer a = lcc.getAuthorizer();
    a.authorize((Activation) null, Authorizer.PROPERTY_WRITE_OP);

        // Get the current transaction controller
        TransactionController tc = lcc.getTransactionExecute();

    tc.setProperty(key, value, false);
    } catch (StandardException se) {
      throw PublicAPI.wrapStandardException(se);
    }
  }
View Full Code Here

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

        // find the language context.
        LanguageConnectionContext lcc = ConnectionUtil.getCurrentLCC();

        // Get the current transaction controller
        TransactionController tc = lcc.getTransactionExecute();

    try {

    // find the DataDictionary
    DataDictionary dd = lcc.getDataDictionary();


    // get the SchemaDescriptor
    SchemaDescriptor sd = dd.getSchemaDescriptor(schemaName, tc, true);
    if ( !isIndex)
    {
      // get the TableDescriptor for the table
      TableDescriptor td = dd.getTableDescriptor(conglomerateName, sd);

      // Return an empty Properties if table does not exist or if it is for a view.
      if ((td == null) || td.getTableType() == TableDescriptor.VIEW_TYPE) { return new Properties(); }

      conglomerateNumber = td.getHeapConglomerateId();
    }
    else
    {
      // get the ConglomerateDescriptor for the index
      ConglomerateDescriptor cd = dd.getConglomerateDescriptor(conglomerateName, sd, false);

      // Return an empty Properties if index does not exist
      if (cd == null) { return new Properties(); }

      conglomerateNumber = cd.getConglomerateNumber();
    }

    ConglomerateController cc = tc.openConglomerate(
                conglomerateNumber,
                false,
                0,
                TransactionController.MODE_RECORD,
                TransactionController.ISOLATION_SERIALIZABLE);

    Properties properties = tc.getUserCreateConglomPropList();
    cc.getTableProperties( properties );

    cc.close();
        return properties;
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.