Package org.apache.derby.impl.sql

Examples of org.apache.derby.impl.sql.GenericPreparedStatement


    Cacheable cachedItem = statementCache.find(statement);

    CachedStatement cs = (CachedStatement) cachedItem;


    GenericPreparedStatement ps = cs.getPreparedStatement();

    synchronized (ps) {
      if (ps.upToDate()) {
        GeneratedClass ac = ps.getActivationClass();

        // Check to see if the statement was prepared before some change
        // in the class loading set. If this is the case then force it to be invalid
        int currentClasses =
            getLanguageConnectionFactory().getClassFactory().getClassLoaderVersion();

        if (ac.getClassLoaderVersion() != currentClasses) {
          ps.makeInvalid(DependencyManager.INTERNAL_RECOMPILE_REQUEST, this);
        }

        // note that the PreparedStatement is not kept in the cache. This is because
        // having items kept in the cache that ultimately are held onto by
        // user code is impossible to manage. E.g. an open ResultSet would hold onto
View Full Code Here


    Cacheable cachedItem = statementCache.find(statement);

    CachedStatement cs = (CachedStatement) cachedItem;


    GenericPreparedStatement ps = cs.getPreparedStatement();

    synchronized (ps) {
      if (ps.upToDate()) {
        GeneratedClass ac = ps.getActivationClass();

        // Check to see if the statement was prepared before some change
        // in the class loading set. If this is the case then force it to be invalid
        int currentClasses =
            getLanguageConnectionFactory().getClassFactory().getClassLoaderVersion();

        if (ac.getClassLoaderVersion() != currentClasses) {
          ps.makeInvalid(DependencyManager.INTERNAL_RECOMPILE_REQUEST, this);
        }

        // note that the PreparedStatement is not kept in the cache. This is because
        // having items kept in the cache that ultimately are held onto by
        // user code is impossible to manage. E.g. an open ResultSet would hold onto
View Full Code Here

          double optimizerEstimatedRowCount,
          double optimizerEstimatedCost)
    throws StandardException
  {
    super(a, resultSetNumber, optimizerEstimatedRowCount, optimizerEstimatedCost);
    final GenericPreparedStatement gp =
      (GenericPreparedStatement)a.getPreparedStatement();
    final Object[] saved = gp.getSavedObjects();

    scoci = (StaticCompiledOpenConglomInfo)saved[scociItem];
    TransactionController tc = activation.getTransactionController();
    dcoci = tc.getDynamicCompiledConglomInfo(conglomId);
        this.source = source;
View Full Code Here

  /**
  */
  public Cacheable setIdentity(Object key) {

    identity = key;
    ps = new GenericPreparedStatement((GenericStatement) key);
    ps.setCacheHolder(this);

    return this;
  }
View Full Code Here

        Cacheable cachedItem = statementCache.find(statement);

        CachedStatement cs = (CachedStatement) cachedItem;


        GenericPreparedStatement ps = cs.getPreparedStatement();

        synchronized (ps) {
            if (ps.upToDate()) {
                GeneratedClass ac = ps.getActivationClass();

                // Check to see if the statement was prepared before some change
                // in the class loading set. If this is the case then force it to be invalid
                int currentClasses =
                        getLanguageConnectionFactory().getClassFactory().getClassLoaderVersion();

                if (ac.getClassLoaderVersion() != currentClasses) {
                    ps.makeInvalid(DependencyManager.INTERNAL_RECOMPILE_REQUEST, this);
                }

                // note that the PreparedStatement is not kept in the cache. This is because
                // having items kept in the cache that ultimately are held onto by
                // user code is impossible to manage. E.g. an open ResultSet would hold onto
View Full Code Here

    if (statementCache != null) {
      final Collection values = statementCache.values();
      data = new Vector<GenericPreparedStatement>(values.size());
      for (Iterator i = values.iterator(); i.hasNext(); ) {
        final CachedStatement cs = (CachedStatement) i.next();
        final GenericPreparedStatement ps =
          (GenericPreparedStatement) cs.getPreparedStatement();
        data.add(ps);
      }
    }
  }
View Full Code Here

          double optimizerEstimatedCost,
          int baseColumnCount)
    throws StandardException
  {
    super(a, resultSetNumber, optimizerEstimatedRowCount, optimizerEstimatedCost);
    final GenericPreparedStatement gp =
      (GenericPreparedStatement)a.getPreparedStatement();

        scoci = (StaticCompiledOpenConglomInfo) gp.getSavedObject(scociItem);
    TransactionController tc = activation.getTransactionController();
    dcoci = tc.getDynamicCompiledConglomInfo(conglomId);
        this.source = source;
    this.indexName = indexName;
    this.forUpdate = forUpdate;
    this.restriction = restriction;
        _baseColumnCount = baseColumnCount;

    /* RESOLVE - once we push Qualifiers into the store we
     * need to clear their Orderable cache on each open/reopen.
     */

    // retrieve the valid column list from
    // the saved objects, if it exists
    if (heapColRefItem != -1) {
            this.accessedHeapCols =
                    (FormatableBitSet) gp.getSavedObject(heapColRefItem);
    }
    if (allColRefItem != -1) {
            this.accessedAllCols =
                    (FormatableBitSet) gp.getSavedObject(allColRefItem);
    }

    // retrieve the array of columns coming from the index
    indexCols =
      ((ReferencedColumnsDescriptorImpl)
                gp.getSavedObject(indexColMapItem))
                .getReferencedColumnPositions();

    /* Get the result row template */
        ExecRow resultRow =
                ((ExecRowBuilder) gp.getSavedObject(resultRowAllocator))
                    .build(a.getExecutionFactory());

    // Note that getCompactRow will assign its return value to the
    // variable compactRow which can be accessed through
    // inheritance. Hence we need not collect the return value
    // of the method.
    getCompactRow(resultRow, accessedAllCols, false);

    /* If there's no partial row bit map, then we want the entire
     * row, otherwise we need to diddle with the row array so that
     * we only get the columns coming from the heap on the fetch.
     */
    if (accessedHeapCols == null) {
      rowArray = resultRow.getRowArray();
    }
    else {
      // Figure out how many columns are coming from the heap

      final DataValueDescriptor[] resultRowArray =
        resultRow.getRowArray();
      final FormatableBitSet heapOnly =
                (FormatableBitSet) gp.getSavedObject(heapOnlyColRefItem);
      final int heapOnlyLen = heapOnly.getLength();

      // Need a separate DataValueDescriptor array in this case
      rowArray =
         new DataValueDescriptor[heapOnlyLen];
View Full Code Here

        Cacheable cachedItem = statementCache.find(statement);

        CachedStatement cs = (CachedStatement) cachedItem;


        GenericPreparedStatement ps = cs.getPreparedStatement();

        synchronized (ps) {
            if (ps.upToDate()) {
                GeneratedClass ac = ps.getActivationClass();

                // Check to see if the statement was prepared before some change
                // in the class loading set. If this is the case then force it to be invalid
                int currentClasses =
                        getLanguageConnectionFactory().getClassFactory().getClassLoaderVersion();

                if (ac.getClassLoaderVersion() != currentClasses) {
                    ps.makeInvalid(DependencyManager.INTERNAL_RECOMPILE_REQUEST, this);
                }

                // note that the PreparedStatement is not kept in the cache. This is because
                // having items kept in the cache that ultimately are held onto by
                // user code is impossible to manage. E.g. an open ResultSet would hold onto
View Full Code Here

    if (statementCache != null) {
      final Collection values = statementCache.values();
      data = new Vector(values.size());
      for (Iterator i = values.iterator(); i.hasNext(); ) {
        final CachedStatement cs = (CachedStatement) i.next();
        final GenericPreparedStatement ps =
          (GenericPreparedStatement) cs.getPreparedStatement();
        data.addElement(ps);
      }
    }
  }
View Full Code Here

        final ContextManager contextManager =
                ((EmbedConnection)c).getContextManager();
        final LanguageConnectionContext lcc =
                (LanguageConnectionContext)contextManager.getContext(
                "LanguageConnectionContext");
        final GenericPreparedStatement derbyPs =
                (GenericPreparedStatement)lcc.getLastActivation().
                getPreparedStatement();

        assertFalse(derbyPs.isValid());

        rollback();
    }
View Full Code Here

TOP

Related Classes of org.apache.derby.impl.sql.GenericPreparedStatement

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.