Examples of Activation


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

     * @param activation the activation
     */
    private SQLSessionContext getCurrentSQLSessionContext(Activation activation) {
        SQLSessionContext curr;

        Activation parent = activation.getParentActivation();

        if (parent == null ) {
            // top level
            curr = getTopLevelSQLSessionContext();
        } else {
            // inside a nested connection (stored procedure/function), or when
            // executing a substatement the SQL session context is maintained
            // in the activation of the parent
            curr = parent.getSQLSessionContextForChildren();
        }

        return curr;
    }
View Full Code Here

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

   */
  public Activation getActivation(LanguageConnectionContext lcc,
                  boolean scrollable)
    throws StandardException
  {
    Activation ac;
    synchronized (this) {
      GeneratedClass gc = getActivationClass();

      if (gc == null) {
        rePrepare(lcc);
View Full Code Here

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

    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

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

    // try to remember the SQL statement in case anybody asks for it
    SQLText = sql;   

    try {
      Activation activation;
      try {
        PreparedStatement preparedStatement = lcc.prepareInternalStatement
            (lcc.getDefaultSchema(), sql, resultSetConcurrency==JDBC20Translation.CONCUR_READ_ONLY, false);
        activation =
          preparedStatement.getActivation(lcc, resultSetType == JDBC20Translation.TYPE_SCROLL_INSENSITIVE);
        checkRequiresCallableStatement(activation);
       } catch (Throwable t) {
        throw handleException(t);
       }


      // this is for a Statement execution
      activation.setSingleExecution();

      //bug 4838 - save the auto-generated key information in activation. keeping this
      //information in lcc will not work work it can be tampered by a nested trasaction
      if (autoGeneratedKeys == JDBC30Translation.RETURN_GENERATED_KEYS)
        activation.setAutoGeneratedKeysResultsetInfo(columnIndexes, columnNames);
      return executeStatement(activation, executeQuery, executeUpdate);
    } finally {
        restoreContextStack();
    }
    }
View Full Code Here

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

                        null,
                        false,
                        0L);
                org.apache.derby.iapi.sql.PreparedStatement ps =
                        lcc.prepareInternalStatement(insertSQL.toString());
                Activation act = ps.getActivation(lcc, false);

                // in this for loop we are assigning values for parameters
                //in sql constructed earlier VALUES (?, ..)
                for (int i=1, paramPosition=0; i<=rd.getColumnCount(); i++) {
                    // if the column got updated, do following
                    if (columnGotUpdated[i-1]) { 
                        act.getParameterValueSet().
                                getParameterForSet(paramPosition++).
                                setValue(updateRow.getColumn(i));
                    }
                }
                // Don't see any timeout when inserting rows (use 0)
View Full Code Here

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

            lcc = getEmbedConnection().getLanguageConnection();

            // Context used for preparing, don't set any timeout (use 0)
            statementContext = lcc.pushStatementContext(isAtomic, false, updateWhereCurrentOfSQL.toString(), null, false, 0L);
            org.apache.derby.iapi.sql.PreparedStatement ps = lcc.prepareInternalStatement(updateWhereCurrentOfSQL.toString());
            Activation act = ps.getActivation(lcc, false);

            //in this for loop we are assigning values for parameters in sql constructed earlier with columnname=?,...
            for (int i=1, paramPosition=0; i<=rd.getColumnCount(); i++) {
                if (columnGotUpdated[i-1])  //if the column got updated, do following
                    act.getParameterValueSet().getParameterForSet(paramPosition++).setValue(updateRow.getColumn(i));
            }
            // Don't set any timeout when updating rows (use 0)
            // Execute the update where current of sql.
            org.apache.derby.iapi.sql.ResultSet rs = ps.execute(act, true, 0L);
            SQLWarning w = act.getWarnings();
            if (w != null) {
                addWarning(w);
            }
            rs.close();
            rs.finish();
View Full Code Here

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

               
                // Context used for preparing, don't set any timeout (use 0)
                statementContext = lcc.pushStatementContext(isAtomic, false, deleteWhereCurrentOfSQL.toString(), null, false, 0L);
                org.apache.derby.iapi.sql.PreparedStatement ps = lcc.prepareInternalStatement(deleteWhereCurrentOfSQL.toString());
                // Get activation, so that we can get the warning from it
                Activation act = ps.getActivation(lcc, false);
                // Don't set any timeout when deleting rows (use 0)
                //execute delete where current of sql
                org.apache.derby.iapi.sql.ResultSet rs =
                        ps.execute(act, true, 0L);
                SQLWarning w = act.getWarnings();
                if (w != null) {
                    addWarning(w);
                }
                rs.close();
                rs.finish();
View Full Code Here

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

    if (cursorName != null)
    {
      // have to see if another activation is open
      // with the same cursor name. If so we can't use this name

      Activation activeCursor = lcc.lookupCursorActivation(cursorName);

      if ((activeCursor != null) && (activeCursor != ac)) {
        throw StandardException.newException(SQLState.LANG_CURSOR_ALREADY_EXISTS, cursorName);
      }
    }
View Full Code Here

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

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

        Activation a1 = (Activation) acts.elementAt(i);
        if (!a1.isInUse()) {
          a1.close();
        }
      }
    }

    if (SanityManager.DEBUG) {
View Full Code Here

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

    int size = acts.size();
    if (size > 0)
    {
      for (int i = 0; i < size; i++) {
         Activation a = (Activation) acts.elementAt(i);

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



        String executingCursorName = a.getCursorName();

         if (cursorName.equals(executingCursorName)) {

          ResultSet rs = a.getResultSet();
          if (rs == null)
            continue;

           // if the result set is closed, the the cursor doesn't exist
           if (rs.isClosed()) {         
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.