Examples of ContextManager


Examples of org.apache.derby.iapi.services.context.ContextManager

  /**
    Get the locale from the ContextManager and then find the bundle
    based upon that locale.
  */
  public ResourceBundle getBundle(String messageId) {
    ContextManager cm;
    try {
      cm = ContextService.getFactory().getCurrentContextManager();
    } catch (ShutdownException se) {
      cm = null;
    }

    if (cm != null) {
      return MessageService.getBundleForLocale(cm.getMessageLocale(), messageId);
    }
    return null;
  }
View Full Code Here

Examples of org.apache.derby.iapi.services.context.ContextManager

     *
     * @exception StandardException thrown if something goes wrong
     */
    private void resetSavepoints() throws StandardException
    {
        final ContextManager cm = getContextManager();
        final List stmts = cm.getContextStack(org.apache.derby.
                                              iapi.reference.
                                              ContextId.LANG_STATEMENT);
        final int end = stmts.size();
        for (int i = 0; i < end; ++i) {
            ((StatementContext)stmts.get(i)).resetSavePoint();
View Full Code Here

Examples of org.apache.derby.iapi.services.context.ContextManager

        XAXactId xid_im = new XAXactId(xid);
        XATransactionState tranState = getTransactionState(xid_im);
       
        if (tranState == null) {
            XAResourceManager rm = ra.getXAResourceManager();
            ContextManager inDoubtCM = rm.find(xid);
            // RM also does not know about this xid.
            if (inDoubtCM == null)
                throw new XAException(XAException.XAER_NOTA);
            ContextService csf = ContextService.getFactory();
            csf.setCurrentContextManager(inDoubtCM);
            try {
                rm.commit(inDoubtCM, xid_im, onePhase);
               
                // close the connection/transaction since it can never
                // be used again. DERBY-4856 No extended diagnostic information needed.
                inDoubtCM.cleanupOnError(StandardException.closeException(),
                        false);
                return;
            } catch (StandardException se) {
                // The rm threw an exception, clean it up in the approprate
                // context.  There is no transactionResource to handle the
                // exception for us.
                inDoubtCM.cleanupOnError(se, con.isActive());
                throw wrapInXAException(se);
            } finally {
                csf.resetCurrentContextManager(inDoubtCM);
            }
           
View Full Code Here

Examples of org.apache.derby.iapi.services.context.ContextManager

        XATransactionState tranState = getTransactionState(xid_im);
       
        if (tranState == null) {
            XAResourceManager rm = ra.getXAResourceManager();
           
            ContextManager inDoubtCM = rm.find(xid);
           
            // RM also does not know about this xid.
            if (inDoubtCM == null)
                throw new XAException(XAException.XAER_NOTA);
           
View Full Code Here

Examples of org.apache.derby.iapi.services.context.ContextManager

       
        XATransactionState tranState = getTransactionState(xid_im);
        if (tranState == null) {
            XAResourceManager rm = ra.getXAResourceManager();
           
            ContextManager inDoubtCM = rm.find(xid);
           
            // RM also does not know about this xid.
            if (inDoubtCM == null)
                throw new XAException(XAException.XAER_NOTA);
           
            ContextService csf = ContextService.getFactory();
           
            csf.setCurrentContextManager(inDoubtCM);
            try {
                rm.forget(inDoubtCM, xid_im);
               
                // close the connection/transaction since it can never be used again.
                inDoubtCM.cleanupOnError(StandardException.closeException(),
                        false);
                return;
            } catch (StandardException se) {
                // The rm threw an exception, clean it up in the approprate
                // context.  There is no transactionResource to handle the
                // exception for us.
                inDoubtCM.cleanupOnError(se, con.isActive());
                throw wrapInXAException(se);
            } finally {
                csf.resetCurrentContextManager(inDoubtCM);
            }
           
View Full Code Here

Examples of org.apache.derby.iapi.services.context.ContextManager

        XATransactionState tranState = getTransactionState(xid_im);
       
        if (tranState == null) {
            XAResourceManager rm = ra.getXAResourceManager();
           
            ContextManager inDoubtCM = rm.find(xid);
           
            // RM also does not know about this xid.
            if (inDoubtCM == null)
                throw new XAException(XAException.XAER_NOTA);
           
            ContextService csf = ContextService.getFactory();
           
            csf.setCurrentContextManager(inDoubtCM);
            try {
                rm.rollback(inDoubtCM, xid_im);
               
                // close the connection/transaction since it can never be used again.
                inDoubtCM.cleanupOnError(StandardException.closeException(),
                        false);
                return;
            } catch (StandardException se) {
                // The rm threw an exception, clean it up in the approprate
                // context.  There is no transactionResource to handle the
                // exception for us.
                inDoubtCM.cleanupOnError(se, con.isActive());
                throw wrapInXAException(se);
            } finally {
                csf.resetCurrentContextManager(inDoubtCM);
            }
           
View Full Code Here

Examples of org.apache.derby.iapi.services.context.ContextManager

    /*
    ** The current connection is the one in the current
    ** connection context, so get the context.
    */
    ContextManager  cm = getCurrentContextManager();

    ConnectionContext localCC = null;

    /*
      cm is null the very first time, and whenever
      we aren't actually nested.
     */
    if (cm != null) {
      localCC = (ConnectionContext)
        (cm.getContext(ConnectionContext.CONTEXT_ID));
    }

    return localCC;
  }
View Full Code Here

Examples of org.apache.derby.iapi.services.context.ContextManager

      // need to invalidate the statement
      if (!isValid || (inUseCount != 0))
        return;

      ContextManager cm = ContextService.getFactory().getCurrentContextManager();
      LanguageConnectionContext lcc =
        (LanguageConnectionContext)
        (cm.getContext(LanguageConnectionContext.CONTEXT_ID));

      // invalidate any prepared statements that
      // depended on this statement (including this one)
      // prepareToInvalidate(this, DependencyManager.PREPARED_STATEMENT_INVALID);
      try
View Full Code Here

Examples of org.apache.derby.iapi.services.context.ContextManager

    if (fid == null)
      throw StandardException.newException(SQLState.LANG_FILE_DOES_NOT_EXIST, sqlName,schemaName);

    long generationId = fid.getGenerationId();

        ContextManager cm = ContextService.getFactory().getCurrentContextManager();
    FileResource fr = af.getTransaction(cm).getFileHandler();

    String externalName = JarUtil.mkExternalName(schemaName, sqlName, fr.getSeparatorChar());

    return fr.getAsFile(externalName, generationId);
View Full Code Here

Examples of org.apache.derby.iapi.services.context.ContextManager

    TableDescriptor        triggerTable,
    TransactionController       tc
  )
    throws StandardException
  {
    ContextManager cm = lcc.getContextManager();
    LanguageConnectionFactory  lcf = lcc.getLanguageConnectionFactory();

    DataDictionary dd = getDataDictionary();

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.