Package org.apache.derby.iapi.sql.dictionary

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


   
    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

      */
      dd.startWriting(lcc);

      for (java.util.ListIterator li = dd.getAllSPSDescriptors().listIterator(); li.hasNext(); )
      {
        SPSDescriptor spsd = (SPSDescriptor) li.next();

        /*
        ** Is it in SYS? if so, zap it. Can't drop metadata SPS in SYSIBM, JCC depends on it.
        */
        if (spsd.getSchemaDescriptor().isSystemSchema() && !spsd.getSchemaDescriptor().isSYSIBM())
        {
          dd.dropSPSDescriptor(spsd, tc);
          dd.dropDependentsStoredDependencies(spsd.getUUID(), tc);
        }
      }
    } catch (StandardException se)
    {
      throw PublicAPI.wrapStandardException(se);
View Full Code Here

    TupleDescriptor      parentTupleDescriptor,
    DataDictionary       dd )
          throws StandardException
  {
    DataValueDescriptor      col;
    SPSDescriptor        descriptor;
    String            name;
    String            text;
    String            usingText;
    UUID            uuid;
    UUID            compUuid;
    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();
    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

     * 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

   * @exception StandardException    Thrown on failure
   */
  public void  executeConstantAction(Activation activation)
            throws StandardException
  {
    SPSDescriptor        whenspsd = null;
    SPSDescriptor        actionspsd;

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

    */
    String spsName = "TRIGGER" +
            (isWhen ? "WHEN_" : "ACTN_") +
            triggerId + "_" + triggerTable.getUUID().toString();

    SPSDescriptor spsd = new SPSDescriptor(dd, spsName,
                  (spsId == null) ?
                    dd.getUUIDFactory().createUUID() :
                    spsId,
                  sd.getUUID(),
                  compSchemaId == null ?
                    lcc.getDefaultSchema().getUUID() :
                    compSchemaId,
                  SPSDescriptor.SPS_TYPE_TRIGGER,
                  true,        // it is valid
                  text,        // the text
                  true )// no defaults

    /*
    ** Prepared the stored prepared statement
    ** and release the activation class -- we
    ** know we aren't going to execute statement
    ** after create it, so for now we are finished.
    */
    spsd.prepareAndRelease(lcc, triggerTable);


    dd.addSPSDescriptor(spsd, tc, true);

    return spsd;
View Full Code Here

          ** the SPP to invalidate it.
          */
          DataDictionary dd = lcc.getDataDictionary();
           
          SchemaDescriptor sd = dd.getSchemaDescriptor(execSchemaName, lcc.getTransactionCompile(), true);
          SPSDescriptor spsd = dd.getSPSDescriptor(execStmtName, sd);
          spsd.makeInvalid(action, lcc);
          break;
        }
        }
      }
    } finally {
View Full Code Here

    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

      */
      dd.startWriting(lcc);

      for (java.util.ListIterator li = dd.getAllSPSDescriptors().listIterator(); li.hasNext(); )
      {
        SPSDescriptor spsd = (SPSDescriptor) li.next();

        /*
        ** Is it in SYS? if so, zap it. Can't drop metadata SPS in SYSIBM, JCC depends on it.
        */
        if (spsd.getSchemaDescriptor().isSystemSchema() && !spsd.getSchemaDescriptor().isSYSIBM())
        {
          dd.dropSPSDescriptor(spsd, tc);
          dd.dropDependentsStoredDependencies(spsd.getUUID(), tc);
        }
      }
    } catch (StandardException se)
    {
      throw PublicAPI.wrapStandardException(se);
View Full Code Here

TOP

Related Classes of org.apache.derby.iapi.sql.dictionary.SPSDescriptor

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.