Examples of SPSDescriptor


Examples of org.apache.derby.iapi.sql.dictionary.SPSDescriptor

   * @exception StandardException    Thrown on failure
   */
  public SPSDescriptor getSPSDescriptor(UUID uuid)
        throws StandardException
  {
    SPSDescriptor     sps;

    /* Make sure that non-core info is initialized */
    getNonCoreTI(SYSSTATEMENTS_CATALOG_NUM);

    /* Only use the cache if we're in compile-only mode */
    if ((spsNameCache != null) &&
      (getCacheMode() == DataDictionary.COMPILE_ONLY_MODE))
    {
      sps = (SPSDescriptor)spsIdHash.get(uuid);
      if (sps != null)
      {
        //System.out.println("found in hash table ");
        // System.out.println("stmt text " + sps.getText());

        return sps;
      }
 
      sps = getSPSDescriptorIndex2Scan(uuid.toString());
      TableKey stmtKey = new TableKey(sps.getSchemaDescriptor().getUUID(), sps.getName());
      try
      {
        SPSNameCacheable   cacheEntry = (SPSNameCacheable)spsNameCache.create(stmtKey, sps);
        spsNameCache.release(cacheEntry);
      } catch (StandardException se)
View Full Code Here

Examples of org.apache.derby.iapi.sql.dictionary.SPSDescriptor

    /* Set up the start/stop position for the scan */
    ExecIndexRow keyRow = exFactory.getIndexableRow(1);
    keyRow.setColumn(1, stmtIDOrderable);

    SPSDescriptor spsd = (SPSDescriptor)
          getDescriptorViaIndex(
            SYSSTATEMENTSRowFactory.SYSSTATEMENTS_INDEX1_ID,
            keyRow,
            (ScanQualifier [][]) null,
            ti,
View Full Code Here

Examples of org.apache.derby.iapi.sql.dictionary.SPSDescriptor

   * @exception StandardException    Thrown on failure
   */
  public SPSDescriptor getSPSDescriptor(String stmtName, SchemaDescriptor sd)
    throws StandardException
  {
    SPSDescriptor    sps = null;
    TableKey      stmtKey;
    UUID        schemaUUID;

    /*
    ** If we didn't get a schema descriptor, we had better
View Full Code Here

Examples of org.apache.derby.iapi.sql.dictionary.SPSDescriptor

    /* Set up the start/stop position for the scan */
    ExecIndexRow keyRow = exFactory.getIndexableRow(2);
    keyRow.setColumn(1, stmtNameOrderable);
    keyRow.setColumn(2, schemaIDOrderable);

    SPSDescriptor spsd = (SPSDescriptor)
          getDescriptorViaIndex(
            SYSSTATEMENTSRowFactory.SYSSTATEMENTS_INDEX2_ID,
            keyRow,
            (ScanQualifier [][]) null,
            ti,
            (TupleDescriptor) null,
            (List) null,
            false);
 
    /*
    ** Set up the parameter defaults.  We are only
    ** doing this when we look up by name because
    ** this is the only time we cache, and it can
    ** be foolish to look up the parameter defaults
    ** for someone that doesn't need them.
    */
    if (spsd != null)
    {
            List tmpDefaults = new ArrayList();
            spsd.setParams(getSPSParams(spsd, tmpDefaults));
            Object[] defaults = tmpDefaults.toArray();
      spsd.setParameterDefaults(defaults);
    }

    return spsd;
  }
View Full Code Here

Examples of org.apache.derby.iapi.sql.dictionary.SPSDescriptor

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

    for (java.util.Iterator li = getAllSPSDescriptors().iterator(); li.hasNext(); )
    {
      SPSDescriptor spsd = (SPSDescriptor) li.next();
      spsd.makeInvalid(DependencyManager.USER_RECOMPILE_REQUEST, lcc);
    }
  }
View Full Code Here

Examples of org.apache.derby.iapi.sql.dictionary.SPSDescriptor

   
    while (e.hasMoreElements())
    {
      String spsName = (String)e.nextElement();
      String spsText =  p.getProperty(spsName);
      SPSDescriptor spsd = new SPSDescriptor(this, spsName,
                           getUUIDFactory().createUUID(),
                           schemaID,
                           schemaID,
                           SPSDescriptor.SPS_TYPE_REGULAR,
                           !nocompile,    // it is valid, unless nocompile
View Full Code Here

Examples of org.apache.derby.iapi.sql.dictionary.SPSDescriptor

   */
  private void dropJDBCMetadataSPSes(TransactionController tc) throws StandardException
  {
    for (java.util.Iterator it = getAllSPSDescriptors().iterator(); it.hasNext(); )
    {
      SPSDescriptor spsd = (SPSDescriptor) it.next();
      SchemaDescriptor sd = spsd.getSchemaDescriptor();

      // don't drop statements in non-system schemas
      if (!sd.isSystemSchema()) {
        continue;
      }

      dropSPSDescriptor(spsd, tc);
      dropDependentsStoredDependencies(spsd.getUUID(),                                                                                                              tc);

    }
  }
View Full Code Here

Examples of org.apache.derby.iapi.sql.dictionary.SPSDescriptor

     * entry.  Don't want to block.
     */
    lcc.beginNestedTransaction(true);

    DataDictionary dd = getLanguageConnectionContext().getDataDictionary();
    SPSDescriptor spsd = dd.getSPSDescriptor(
                    spsName,
                    net ? dd.getSysIBMSchemaDescriptor() :
                    dd.getSystemSchemaDescriptor());
    lcc.commitNestedTransaction();

View Full Code Here

Examples of org.apache.derby.iapi.sql.dictionary.SPSDescriptor

    TupleDescriptor      parentTupleDescriptor,
    DataDictionary       dd )
          throws StandardException
  {
    DataValueDescriptor      col;
    SPSDescriptor        descriptor;
    String            name;
    String            text;
    String            usingText;
    UUID            uuid;
    UUID            compUuid = null;
    String            uuidStr;
    UUID            suuid;    // schema
    String            suuidStr;  // schema
    String            typeStr;
    char            type;
    boolean            valid;
    Timestamp          time = null;
    ExecPreparedStatement    preparedStatement = null;
    boolean            initiallyCompilable;
    DataDescriptorGenerator    ddg = dd.getDataDescriptorGenerator();

    if (SanityManager.DEBUG)
    {
      SanityManager.ASSERT(row.nColumns() == SYSSTATEMENTS_COLUMN_COUNT,
                 "Wrong number of columns for a SYSSTATEMENTS row");
    }

    // 1st column is STMTID (UUID - char(36))
    col = row.getColumn(1);
    uuidStr = col.getString();
    uuid = getUUIDFactory().recreateUUID(uuidStr);

    // 2nd column is STMTNAME (varchar(128))
    col = row.getColumn(2);
    name = col.getString();

    // 3rd column is SCHEMAID (UUID - char(36))
    col = row.getColumn(3);
    suuidStr = col.getString();
    suuid = getUUIDFactory().recreateUUID(suuidStr);

    // 4th column is TYPE (char(1))
    col = row.getColumn(4);
    type = col.getString().charAt(0);

    if (SanityManager.DEBUG)
    {
      if (!SPSDescriptor.validType(type))
      {
        SanityManager.THROWASSERT("Bad type value ("+type+") for  statement "+name);
      }
    }

    // In soft upgrade mode the plan may not be understand by this engine
    // so force a recompile.
    if (((DataDictionaryImpl) dd).readOnlyUpgrade) {
      valid = false;
    } else {
      // 5th column is VALID (boolean)
      col = row.getColumn(5);
      valid = col.getBoolean();
    }

    // 6th column is TEXT (LONG VARCHAR)
    col = row.getColumn(6);
    text = col.getString();

    /* 7th column is LASTCOMPILED (TIMESTAMP) */
    col = row.getColumn(7);
    time = col.getTimestamp(new java.util.GregorianCalendar());

    // 8th column is COMPILATIONSCHEMAID (UUID - char(36))
    col = row.getColumn(8);
    uuidStr = col.getString();
    if (uuidStr != null)
      compUuid = getUUIDFactory().recreateUUID(uuidStr);

    // 9th column is TEXT (LONG VARCHAR)
    col = row.getColumn(9);
    usingText = col.getString();

    // 10th column is CONSTANTSTATE (COM...ExecPreparedStatement)

    // Only load the compiled plan if the statement is valid
    if (valid) {
      col = row.getColumn(10);
      preparedStatement = (ExecPreparedStatement) col.getObject();
    }

    // 11th column is INITIALLY_COMPILABLE (boolean)
    col = row.getColumn(11);
    if ( col.isNull() ) { initiallyCompilable = true; }
    else { initiallyCompilable = col.getBoolean(); }

    descriptor = new SPSDescriptor(dd, name,
                  uuid,
                  suuid,
                  compUuid,
                  type,
                  valid,
View Full Code Here

Examples of org.apache.derby.iapi.sql.dictionary.SPSDescriptor

     * entry.  Don't want to block.
     */
    lcc.beginNestedTransaction(true);

    DataDictionary dd = getLanguageConnectionContext().getDataDictionary();
    SPSDescriptor spsd = dd.getSPSDescriptor(
                    spsName,
                    net ? dd.getSysIBMSchemaDescriptor() :
                    dd.getSystemSchemaDescriptor());
    lcc.commitNestedTransaction();

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.