Package org.apache.derby.iapi.sql

Examples of org.apache.derby.iapi.sql.Activation


    // synchronize on acts as other threads may be closing activations
    // in this list, thus invalidating the Enumeration
    for (int i = acts.size() - 1; i >= 0; i--) {
       
      Activation a = (Activation) acts.elementAt(i);

      if (!a.isInUse())
      {
        continue;
      }
     
      /* for this prepared statement */
      if (pStmt == a.getPreparedStatement()) {
        ResultSet rs = a.getResultSet();

        /* is there an open result set? */
        if (rs != null && ! rs.isClosed())
        {
          if (!rs.returnsRows())
            continue;
          seenOpenResultSets = true;
          break;
        }
       
      }
    }

    if (!seenOpenResultSets)
      return false;

    // There may be open ResultSet's that are yet to be garbage collected
    // let's try and force these out rather than throw an error
    System.gc();
    System.runFinalization();


    /* For every activation */
    // synchronize on acts as other threads may be closing activations
    // in this list, thus invalidating the Enumeration
    for (int i = acts.size() - 1; i >= 0; i--) {
       
      Activation a = (Activation) acts.elementAt(i);

      if (!a.isInUse())
      {
        continue;
      }

      /* for this prepared statement */
      if (pStmt == a.getPreparedStatement()) {
        ResultSet rs = a.getResultSet();

        /* is there an open result set? */
        if (rs != null && ! rs.isClosed())
        {
          if ((provider != null) && rs.returnsRows()) {
View Full Code Here


        // it maybe the case that a reset()/close() ends up closing
        // one or more activation leaving our index beyond
        // the end of the array
        if (i >= acts.size())
          continue;
        Activation a = (Activation) acts.elementAt(i);
        a.reset();
        a.close();
      }
                      
      popMe();
    }
View Full Code Here

      // one or more activation leaving our index beyond
      // the end of the array
      if (i >= acts.size())
        continue;

      Activation a = (Activation) acts.elementAt(i);
      /*
      ** andClose true means we are here for rollback.
      ** In case of rollback, we don't care for holding
      ** cursors and that's why I am resetting holdability
      ** to false for all activations just before rollback
      */ 
      if (andClose)
        a.setResultSetHoldability(false);

      /*
      ** Look for stale activations.  Activations are
      ** marked as unused during statement finalization.
      ** Here, we sweep and remove this inactive ones.
      */ 
      if (!a.isInUse())
      {
        a.close();
        continue;
      }

      a.reset();

      // Only invalidate statements if we performed DDL.
      if (andClose && dataDictionaryInWriteMode()) {
        ExecPreparedStatement ps = a.getPreparedStatement();
        if (ps != null) {
          ps.makeInvalid(DependencyManager.ROLLBACK, this);
        }
      }
    }
View Full Code Here

    if (gc == null) {
      rePrepare(lcc);
      gc = getActivationClass();
    }

    Activation ac = new GenericActivationHolder(lcc, gc, this, scrollable);

    inUseCount++;

    return ac;
  }
View Full Code Here

    public ResultSet execute(LanguageConnectionContext lcc,
                             boolean rollbackParentContext,
                             long timeoutMillis)
    throws StandardException
  {
    Activation a = getActivation(lcc, false);
    a.setSingleExecution();
    return execute(a, rollbackParentContext, timeoutMillis);
  }
View Full Code Here

   */
  public ResultSet getInsertResultSet(NoPutResultSet source,
                    GeneratedMethod checkGM)
    throws StandardException
  {
    Activation activation = source.getActivation();
    getAuthorizer(activation).authorize(activation, Authorizer.SQL_WRITE_OP);
    return new InsertResultSet(source, checkGM, activation );
  }
View Full Code Here

  public ResultSet getInsertVTIResultSet(NoPutResultSet source,
                    NoPutResultSet vtiRS
                    )
    throws StandardException
  {
    Activation activation = source.getActivation();
    getAuthorizer(activation).authorize(activation, Authorizer.SQL_WRITE_OP);
    return new InsertVTIResultSet(source, vtiRS, activation );
  }
View Full Code Here

    @exception StandardException thrown on error
   */
  public ResultSet getDeleteVTIResultSet(NoPutResultSet source)
    throws StandardException
  {
    Activation activation = source.getActivation();
    getAuthorizer(activation).authorize(activation, Authorizer.SQL_WRITE_OP);
    return new DeleteVTIResultSet(source, activation);
  }
View Full Code Here

    @exception StandardException thrown on error
   */
  public ResultSet getDeleteResultSet(NoPutResultSet source)
      throws StandardException
  {
    Activation activation = source.getActivation();
    getAuthorizer(activation).authorize(activation, Authorizer.SQL_WRITE_OP);
    return new DeleteResultSet(source, activation );
  }
View Full Code Here

                         int constantActionItem,
                         ResultSet[] dependentResultSets,
                         String resultSetId)
    throws StandardException
  {
    Activation activation = source.getActivation();
    getAuthorizer(activation).authorize(activation, Authorizer.SQL_WRITE_OP);
    return new DeleteCascadeResultSet(source, activation,
                      constantActionItem,
                      dependentResultSets,
                      resultSetId);
View Full Code Here

TOP

Related Classes of org.apache.derby.iapi.sql.Activation

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.