Invokes our implementation for methods of org.hibernate.engine.transaction.jta.platform.spi.JtaPlatform
338190
@Override
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
        String methodName = method.getName();
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            Tr.entry(this, tc, methodName, args);
        Object r = null;
        try {
            if (args == null || args.length == 0) {
                if ("canRegisterSynchronization".equals(methodName))
                    r = canRegisterSynchronization();
                else if ("getCurrentStatus".equals(methodName))
                    r = getCurrentStatus();
                else if ("hashCode".equals(methodName))
                    r = System.identityHashCode(this);
                else if ("retrieveTransactionManager".equals(methodName))
                    r = retrieveTransactionManager();
                else if ("retrieveUserTransaction".equals(methodName))
                    r = retrieveUserTransaction();
                else if ("toString".equals(methodName))
                    r = new StringBuilder(getClass().getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).toString();
            } else {
                if ("equals".equals(methodName))
                    r = proxy == args[0]; // assumes one proxy per invocation handler
                else if ("getTransactionIdentifier".equals(methodName))
                    r = getTransactionIdentifier((Transaction) args[0]);
                else if ("registerSynchronization".equals(methodName))
                    registerSynchronization((Synchronization) args[0]);
            }
        } catch (Throwable x) {
            if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
                Tr.exit(this, tc, methodName, x);
            throw x;
        }

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            Tr.exit(this, tc, methodName, r);
        return r;
    }
1288170
private void cmdExecuteActionPerformed(java.awt.event.ActionEvent evt) {
		releaseResultset();
		try {
			if (selectedSource == null) {
				JOptionPane.showMessageDialog(this, "Please select data source first", "Error", JOptionPane.ERROR_MESSAGE);
			} else {
				OBDAProgressMonitor progMonitor = new OBDAProgressMonitor("Executing query...", getRootPane());
				CountDownLatch latch = new CountDownLatch(1);
				ExecuteSQLQueryAction action = new ExecuteSQLQueryAction(latch);
				progMonitor.addProgressListener(action);
				progMonitor.start();
				action.run();
				latch.await();
				progMonitor.stop();
				ResultSet set = action.getResult();
				if (set != null) {
					ResultSetTableModel model = new ResultSetTableModel(set);
					tblQueryResult.setModel(model);
					set.close();
				}
			}
		} catch (Exception e) {
			OptionPaneUtils.showPrettyMessageDialog(null, e.getMessage(), "Error", JOptionPane.ERROR_MESSAGE);
			log.error("Error while executing query.", e);
		}
	}
826072
public void postInvoke(EJSWrapperBase wrapper, int methodId,
                           EJSDeployedSupport s) throws RemoteException {
        // LIDB2775-23.1
        DispatchEventListenerCookie[] dispatchEventListenerCookies = null;// @MD16426A
        EJBMethodInfoImpl methodInfo = s.methodInfo; // d114406 d154342.4 d173022
        final boolean isTraceOn = TraceComponent.isAnyTracingEnabled(); // d532639.2

        // If this is a stateless SessionBean create, run only the bare minimum of
        // collaborators and other processing. This path is encapsulated in a separate
        // method for now, to avoid lots of "if" statements within this method.
        if (methodInfo.isStatelessSessionBean && methodInfo.isHomeCreate) {
            EjbPostInvokeForStatelessCreate(wrapper, methodId, s);
        } else {
            if (isTraceOn) {
                if (TEEJBInvocationInfo.isTraceEnabled())
                    TEEJBInvocationInfo.tracePostInvokeBegins(s, wrapper); // d161864

                if (tcClntInfo.isDebugEnabled())
                    Tr.debug(tcClntInfo, "postInvoke(" + methodInfo.getMethodName() + ")");

                if (tc.isEntryEnabled())
                    Tr.entry(tc, "EJBpostInvoke(" + methodId + ":" +
                                 methodInfo.getMethodName() + ")");
            }

            EJBThreadData threadData = s.ivThreadData; // d646139.1
            BeanId beanId = wrapper.beanId;
            BeanO beanO = null;
            BeanMetaData bmd = null;//92702

            // UOWManager.runUnderUOW may have left cached currentTx invalid; reset
            if (s.resetCurrentTx) {
                if (isTraceOn && tc.isDebugEnabled())
                    Tr.debug(tc, "s.currentTx may be invalid; reset");
                s.currentTx = getCurrentContainerTx();
            }

            // LIDB2775-23.1
            // Do SMF after method recording - // MD16426A - begin
            if (isZOS) {
                dispatchEventListenerCookies = s.ivDispatchEventListenerCookies;
                if (dispatchEventListenerCookies != null) {
                    // notify event dispatch listeners -
                    // Note: It is important that the 'afterEjbMethod' notification
                    //       occur as the first event during postInvoke so that this
                    //       signal is delivered as close as possible to the actual return
                    //       from the bean method invocation.
                    this.ivDispatchEventListenerManager.callDispatchEventListeners(DispatchEventListener.AFTER_EJBMETHOD, dispatchEventListenerCookies, methodInfo);// @MD16426A
                } // @MD16426A
            }

            try {

                beanO = s.beanO;//d140003.19

                if (s.exType != ExceptionType.NO_EXCEPTION) { // d113344  //d140003.19
                    //87918.8(2)
                    if (s.exType == ExceptionType.CHECKED_EXCEPTION) { // d113344 //d140003.19
                        if (isTraceOn && tc.isEventEnabled())
                            Tr.event(tc, "Bean method threw exception",
                                     s.getException());//d140003.19
                    } else if (s.exType == ExceptionType.UNCHECKED_EXCEPTION) {
                        if (isTraceOn && tc.isEventEnabled())
                            Tr.event(tc, "Bean method threw unchecked exception",
                                     s.getException()); //d140003.19
                        // d113344
                        if (beanO != null && s.preInvokeException == false) {
                            // This indicates unchecked exception came from the business
                            // method itself, so we want to discard the bean instance.
                            beanO.discard();
                        }

                        if (isTraceOn && tc.isEventEnabled())
                            Tr.event(tc, "Bean Discarded as non null");

                    }
                }

                //89188
                // bmd = (BeanMetaData) internalBeanMetaDataStore.get(wrapper.beanId.getJ2EEName());//89554
                // d110126
                // Optimizations to preInvoke/postInvoke processing:
                // Created specialized case for stateless SessionBean creation
                // BeanMetaData no longer looked up via hashtable, is now stored in the EJSWrapper
                // Removed extraneous call to TxCntl.getCurrentTransaction (dead code)

                bmd = wrapper.bmd; // d110126
                //end 89188

                // Call postInvoke on all of the BeforeActivation Collaborators
                // that were successfully preInvoked. Note that the order is the
                // same as preInvoke. Note the ComponentMetaDataCollaborator is
                // no longer in this list; see below.              d228192 LI3795-56
                if (ivBeforeActivationCollaborators != null) {
                    for (int i = 0; i < s.ivBeforeActivationPreInvoked; i++) {
                        if (isTraceOn && tc.isDebugEnabled())
                            Tr.debug(tc, "postInvoke : Invoking BeforeActivationCollaborator.postInvoke method on: "
                                         + ivBeforeActivationCollaborators[i].getClass().getName());

                        Object cookie = s.ivBeforeActivationCookies == null ? null : s.ivBeforeActivationCookies[i]; // F61004.3
                        notifyPostInvoke(ivBeforeActivationCollaborators[i], s, cookie);
                    }
                }

                // Call postInvoke on all of the AfterActivation Collaborators
                // that were successfully preInvoked. Note that the order is the
                // same as preInvoke.                                        d228192
                if (ivAfterActivationCollaborators != null) {
                    for (int i = 0; i < s.ivAfterActivationPreInvoked; i++) {
                        if (isTraceOn && tc.isDebugEnabled())
                            Tr.debug(tc, "postInvoke : Invoking AfterActivationCollaborator.postInvoke method on: "
                                         + ivAfterActivationCollaborators[i].getClass().getName());

                        Object cookie = s.ivAfterActivationCookies == null ? null : s.ivAfterActivationCookies[i]; // F61004.3
                        notifyPostInvoke(ivAfterActivationCollaborators[i], s, cookie);
                    }
                }

                if (beanO != null) {
                    beanO.postInvoke(methodId, s);
                }

            } catch (RemoteException ex) {
                FFDCFilter.processException(ex, CLASS_NAME + ".postInvoke", "2268", new Object[] { this, wrapper, Integer.valueOf(methodId), s });//123338
                if (isTraceOn && tc.isEventEnabled())
                    Tr.event(tc, "postInvoke failed", ex);
                throw ex;
            } catch (Throwable ex) {
                FFDCFilter.processException(ex, CLASS_NAME + ".postInvoke", "2273", new Object[] { this, wrapper, Integer.valueOf(methodId), s });//123338
                if (isTraceOn && tc.isEventEnabled())
                    Tr.event(tc, "postInvoke failed", ex);

                s.setUncheckedException(ex); //d117817
            } finally {

                // LIDB2775-23.1
                if (isZOS && dispatchEventListenerCookies != null) {
                    // Before transaction context changes, do SMF end dispatch recording
                    this.ivDispatchEventListenerManager.callDispatchEventListeners(DispatchEventListener.END_DISPATCH, dispatchEventListenerCookies, methodInfo); // @MD16426A
                }

                final ContainerTx currentTx = s.currentTx;//d140003.19

                try {
                    if (beanO != null) {
                        activator.postInvoke(currentTx, beanO);
                    }

                    if (currentTx != null) {
                        currentTx.postInvoke(s);
                    }

                    if (s.uowCtrlPreInvoked) {
                        if (s.began && currentTx != null && currentTx.ivPostInvokeContext == null) {
                            // Indicate that afterCompletion should call
                            // postInvokePopCallbackContexts.                 RTC107108
                            // Don't do see if this is a nested EJB call from
                            // beforeCompletion.                              RTC115108
                            currentTx.ivPostInvokeContext = s;
                        }

                        uowCtrl.postInvoke(beanId, s.uowCookie, s.exType, methodInfo); // d113344 //d140003.19
                    }
                    // Since 'Lightweight' methods may not be executing the
                    // Transaction Collaborator, the postInvoke processing must
                    // be done here.                                        LI3795-56
                    else if (methodInfo.isLightweightTxCapable && s.currentTx != null) {
                        if (s.isLightweight) {
                            if (s.exType == ExceptionType.UNCHECKED_EXCEPTION) {
                                // In this scenario, there is always an inherited global
                                // transaction, and the correct action for all Tx
                                // Strategies is to mark the tx as rollbackonly and throw
                                // the CSITransactionRolledbackException, forcing the
                                // catch block below.
                                if (isTraceOn && tc.isDebugEnabled())
                                    Tr.debug(tc, "Lightweight:handleException - rollback");
                                uowCtrl.setRollbackOnly();
                                throw new CSITransactionRolledbackException("Unexpected Exception from Lightweight EJB method");
                            }
                        } else if (beanO != null &&
                                   bmd.type == InternalConstants.TYPE_STATEFUL_SESSION) {
                            // Simulate transaction commit for the bean.  We do not
                            // need to call ContainerTx.delist because we avoided
                            // ContainerTx.enlist during activation.            F61004.1
                            beanO.beforeCompletion();
                            simulateCommitBean(beanO, currentTx);
                        }
                    }

                    // If a remove method was invoked, and the bean instance was
                    // NOT removed during afterCompletion, then the transaction
                    // did not commit.. and thus a RemoveException should be
                    // thrown.  Stateful beans may NOT be removed while still
                    // enlisted in a transaction.  The RemoveException will be
                    // wrapped in the appropriate exception, as it is generally
                    // not on the throws clause for @Remove methods.           390657
                    if (currentTx != null &&
                        currentTx.ivRemoveBeanO != null) {
                        // Per a SUN (CTS) clarification, not removing a SF bean
                        // in a transaction will only be enforced for Bean Managed
                        // beans, since the UserTx is 'sticky' and would be
                        // orphanded if the bean were removed.                 d451675
                        if (bmd.usesBeanManagedTx ||
                            bmd.usesBeanManagedAS) {
                            currentTx.ivRemoveBeanO = null;
                            throw new RemoveException("Cannot remove stateful session bean " +
                                                      "within a transaction.");
                        } else {
                            // For the CMT case, the bean will just be removed from
                            // the transaction and removed.. without calling the
                            // synchronization methods. The following will transition
                            // the bean to the correct state, and remove from the
                            // EJB Cache... deleting the bean.                  d451675

                            // d666718 - Delist the bean from the transaction.
                            // Otherwise, we will try to perform redundant processing
                            // on it later when the transaction actually completes.
                            try {
                                currentTx.delist(beanO);
                            } catch (TransactionRolledbackException ex) {
                                FFDCFilter.processException(ex, CLASS_NAME + ".postInvoke",
                                                            "4641", this);
                                if (isTraceOn && tc.isEventEnabled())
                                    Tr.event(tc, "Exception thrown from ContainerTx.delist()",
                                             new Object[] { beanO, ex });
                            }

                            simulateCommitBean(beanO, currentTx);
                        }
                    }

                } catch (CSITransactionRolledbackException ex) {
                    FFDCFilter.processException(ex, CLASS_NAME + ".postInvoke",
                                                "2326", new Object[] { this, wrapper, Integer.valueOf(methodId), s });//123338
                    postInvokeRolledbackException(s, ex);
                } catch (Throwable t) {
                    FFDCFilter.processException(t, CLASS_NAME + ".postInvoke",
                                                "2366", this);
                    if (isTraceOn && tc.isDebugEnabled())
                        Tr.debug(tc, "postInvoke: Exception in finally clause. An unexpected case", t);

                    if (s.exType == ExceptionType.NO_EXCEPTION) { //PQ94124
                        // An unexpected exception has occured in post processing,
                        // that the application is unaware of.
                        // call setUnCheckedEx and throw an exception.
                        s.setUncheckedException(t); //d117817
                        // s.setUncheckedException throws either runtime (for local I/F) or
                        // remote exception.
                    }
                } finally {
                    // Bean-specific contexts need to be present for beforeCompletion
                    // for JPA @PreUpdate, so we cannot pop the contexts prior to
                    // transaction completion, but ContainerTx.afterCompletion unpins
                    // beans from the current transaction, which would leave "stale"
                    // contexts in place for subsequent afterCompletion callbacks,
                    // so ContainerTx.afterCompletion pops contexts.  However, we
                    // need to pop contexts ourselves if there was no transaction, or
                    // the transaction wasn't committed (because this method didn't
                    // begin it or it was a sticky BMT), or the transaction was
                    // committed but ContainerTx.afterCompletion wasn't called due to
                    // some fatal error in transactions.                    RTC107108
                    if (currentTx == null) {
                        postInvokePopCallbackContexts(s);
                    } else if (!s.began || currentTx.ivPostInvokeContext != null) {
                        postInvokePopCallbackContexts(s);

                        // Reset the indicator so that sticky BMT doesn't pop the
                        // callback context in the middle of a bean method, but only
                        // do so if we set the method context above (don't do so if
                        // this is a nested EJB call from beforeCompletion). RTC115108
                        if (currentTx.ivPostInvokeContext == s) {
                            currentTx.ivPostInvokeContext = null;
                        }
                    }

                    // Pmi instrumentation for methods in beans
                    // Use pmiBean cached in the wrapper.                  d140003.33
                    // Insure this is done even if an exception is thrown.    d623908
                    EJBPMICollaborator pmiBean = wrapper.ivPmiBean; // d174057.2
                    if (pmiBean != null && s.pmiPreInvoked) {
                        pmiBean.methodPostInvoke(wrapper.beanId, methodInfo,
                                                 s.pmiCookie);

                        if (methodInfo.isHomeCreate()) {
                            // d647928 - SFSB and entity creation always goes through
                            // home wrappers.  The other bean types have code in
                            // EJSHome for create time.
                            if (bmd.isStatefulSessionBean() || bmd.isEntityBean()) {
                                pmiBean.finalTime(EJBPMICollaborator.CREATE_RT, s.pmiCookie);
                            }
                        } else if (methodInfo.isComponentRemove()) {
                            // d647928 - SFSB and entity can both be removed via the
                            // remove method on the wrapper.  That method is a no-op
                            // for the other bean types.
                            if (bmd.isStatefulSessionBean() || bmd.isEntityBean()) {
                                pmiBean.finalTime(EJBPMICollaborator.REMOVE_RT, s.pmiCookie);
                            }
                        }
                    }

                    // PQ74774 Begins
                    if (s.ivSecurityCollaborator != null) {
                        notifyPostInvoke(s.ivSecurityCollaborator, s, s.securityCookie);
                    }
                    // PQ74774 Ends

                    //92702 - BAAC collaborators must be called last of all
                    //the only example we know of is the JNS collaborator
                    if (ivBeforeActivationAfterCompletionCollaborators != null) {
                        // Call postInvoke on all of the BeforeActivationAfterCompletion
                        // Collaborators that were successfully preInvoked. Note that
                        // the order is the same as preInvoke.                    d228192
                        for (int i = 0; i < s.ivBeforeActivationAfterCompletionPreInvoked; i++) {
                            if (isTraceOn && tc.isDebugEnabled())
                                Tr.debug(tc, "postInokve : Invoking BeforeActivationAfterCompletionCollaborator.postInvoke method on: "
                                             + ivBeforeActivationAfterCompletionCollaborators[i].getClass().getName());

                            Object cookie = s.ivBeforeActivationAfterCompletionCookies == null ? null : s.ivBeforeActivationAfterCompletionCookies[i]; // F61004.3
                            notifyPostInvoke(ivBeforeActivationAfterCompletionCollaborators[i], s, cookie);
                        }
                    }

                    // Inform EJB method callback that method has completed. This must be
                    // called after the transaction has completed.
                    if (s.ivEJBMethodCallback != null) {
                        // hmmmm, what if exception occurs?  Same problem as if beforeActivationAfterCompletion
                        // collaborators throw an exception prior to this change.
                        s.invocationCallbackPostInvoke(); // d194342.1.1
                    }

                    // drop the reference on the wrapper
                    // Not required if the wrapper has already been removed
                    if (s.unpinOnPostInvoke) //d140003.19
                        wrapperManager.postInvoke(wrapper);

                    // If preInvoke began the transaction, then the ContainerTx
                    // is no longer in use, and so may be cleared, so just call
                    // releaseResources() to clear all of the fields... making garbage
                    // collection eaiser, and allows things to be garbage collected
                    // even if some other object (like PM) holds a reference to the
                    // ContainerTx for awhile.                     d154342.10 d156606
                    // Note that 'began' for the ContainerTx is not valid at this
                    // point, since the postInvoke call on it restored the 'began'
                    // setting to the previous method state, so use the 'began' flag
                    // in EJSDeployedSupport (valid for current method).      d156688
                    if (s.currentTx != null && s.began) {
                        s.currentTx.releaseResources(); // d215317
                        s.currentTx = null;
                    }

                    // 112678.6 d115602-1
                    if (methodInfo.setClassLoader) {
                        EJBThreadData.svThreadContextAccessor.popContextClassLoaderForUnprivileged(s.oldClassLoader);
                    } else {
                        threadData.popORBWrapperClassLoader();
                    }

                    //92682
                    threadData.popMethodContext(); // d646139.1, RTC102449

                    // d161864 Begins
                    if (isTraceOn) {
                        if (tc.isEntryEnabled())
                            Tr.exit(tc, "EJBpostInvoke(" + methodId + ":" +
                                        methodInfo.getMethodName() + ")" +
                                        ((s.ivException != null) ? ("**** throws " + s.ivException) : ""));
                        if (TEEJBInvocationInfo.isTraceEnabled()) {
                            if (s.ivException == null) {
                                TEEJBInvocationInfo.tracePostInvokeEnds(s, wrapper);
                            } else {
                                TEEJBInvocationInfo.tracePostInvokeException(s, wrapper,
                                                                             s.ivException);
                            }
                        }
                    }
                    // d161864 Ends
                } //end 92702
            }
        }
    }
952239
@Override
	public void invoke(IN tuple) {

		tupleList.add(tuple);
		if (updateCondition()) {
			format.write(path, tupleList);
			resetParameters();
		}

	}
472910
public void execute() {
        State currentState = state.getAndSet(State.RUNNING);
        if (currentState == State.RUNNING) {
            throw new IllegalStateException(
                    "ExecutionChain is already running!");
        }
        executeRunnable = new ExecuteRunnable();
    }
1172121
public void run() {
		// need <bean id="..." class="org.esupportail.commons.context.ApplicationContextHolder" />
		ApplicationContext applicationContext = ApplicationContextHolder.getContext();

		SessionFactory sessionFactory = HibernateUtils.getSessionFactory(applicationContext);
		boolean participate = HibernateUtils.openSession(sessionFactory);

		try {
			if (logger.isDebugEnabled()) {
				logger.debug("Starting new Thread to manage ack with : " + 
					     " - smid : " + acknowledgment.getSmsId() + 
					     " - ack status : " + acknowledgment.getSmsStatus());
			}

			// Send the ack to the business layer 
			final AckManagerBusiness ackManagerBusiness = (AckManagerBusiness) applicationContext.getBean(ACK_BUSINESS_MGR_BEAN_NAME);
			ackManagerBusiness.manageAck(acknowledgment);

		// error case, rollback
		} catch (RuntimeException e) {
			logger.error("Catching exception in AckManagerThread, now rollback : ", e);
			throw e;
		// close the session every time	
		} finally {
		    HibernateUtils.closeSession(sessionFactory, participate);
		}
	 }
899227
@Override
	public void invoke(IN next, Context context) throws Exception {
		// propagate asynchronous errors
		checkErroneous();

		byte[] serializedKey = schema.serializeKey(next);
		byte[] serializedValue = schema.serializeValue(next);
		String targetTopic = schema.getTargetTopic(next);
		if (targetTopic == null) {
			targetTopic = defaultTopicId;
		}

		int[] partitions = this.topicPartitionsMap.get(targetTopic);
		if (null == partitions) {
			partitions = getPartitionsByTopic(targetTopic, producer);
			this.topicPartitionsMap.put(targetTopic, partitions);
		}

		ProducerRecord<byte[], byte[]> record;
		if (flinkKafkaPartitioner == null) {
			record = new ProducerRecord<>(targetTopic, serializedKey, serializedValue);
		} else {
			record = new ProducerRecord<>(
					targetTopic,
					flinkKafkaPartitioner.partition(next, serializedKey, serializedValue, targetTopic, partitions),
					serializedKey,
					serializedValue);
		}
		if (flushOnCheckpoint) {
			synchronized (pendingRecordsLock) {
				pendingRecords++;
			}
		}
		producer.send(record, callback);
	}
46247
public void localBegin()
    {
        if (this.isInLocalTransaction)
        {
            throw new TransactionInProgressException("Connection is already in transaction");
        }
        Connection connection = null;
        try
        {
            connection = this.getConnection();
        }
        catch (LookupException e)
        {
            /**
             * must throw to notify user that we couldn't start a connection
             */
            throw new PersistenceBrokerException("Can't lookup a connection", e);
        }
        if (log.isDebugEnabled()) log.debug("localBegin was called for con " + connection);
        // change autoCommit state only if we are not in a managed environment
        // and it is enabled by user
        if(!broker.isManaged())
        {
            if (jcd.getUseAutoCommit() == JdbcConnectionDescriptor.AUTO_COMMIT_SET_TRUE_AND_TEMPORARY_FALSE)
            {
                if (log.isDebugEnabled()) log.debug("Try to change autoCommit state to 'false'");
                platform.changeAutoCommitState(jcd, connection, false);
            }
        }
        else
        {
            if(log.isDebugEnabled()) log.debug(
                        "Found managed environment setting in PB, will skip Platform.changeAutoCommitState(...) call");
        }
        this.isInLocalTransaction = true;
    }
1098233
private <I extends Message, O extends Message> ListenableFuture<JsonRpcResponse> invoke(
      ServerMethod<I, O> method, JsonObject parameter, JsonElement id) {
    I request;
    try {
      request = (I) Messages.fromJson(method.inputBuilder(), parameter);
    } catch (Exception e) {
      serverLogger.logServerFailure(method, e);
      SettableFuture<JsonRpcResponse> future = SettableFuture.create();
      future.setException(e);
      return future;
    }
    ListenableFuture<O> response = method.invoke(request);
    return Futures.transform(response, new JsonConverter(id), TRANSFORM_EXECUTOR);
  }
978387
public void execute(TransactionCommon t) throws Throwable
    {
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
        SibTr.entry(tc, "execute", t);

      _aiStream.removeCompletedPrefix(
        t,
        _messageProcessor.getMessageStore().getUniqueLockID(AbstractItem.STORE_NEVER));
      synchronized (_persistentStreamState)
      {
        if (_streamStateRemoveNeedsToWait)
        {
          _persistentStreamState.wait();
        }

        long lockID = _messageProcessor.getMessageStore().getUniqueLockID(AbstractItem.STORE_NEVER);
        _persistentStreamState.lockItemIfAvailable(lockID);
        Transaction msTran = _messageProcessor.resolveAndEnlistMsgStoreTransaction(t);
        _persistentStreamState.remove(msTran, lockID);
      }

      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
        SibTr.exit(tc, "execute");
    }
1008130
@Override
  public <T> T publish(Class<T> beanType, Object id, Transaction transaction) {
    methodCalls.add(MethodCall.of(PUBLISH).with("beanType", beanType).with("id", id));
    return !persistPublish ? null : publish.publish(beanType, id, transaction);
  }
1272786
@Override
    public int doStartTag() throws JspException {

        if ((rawDataSource == null) && dataSourceSpecified) {
            throw new JspException(
                    Resources.getMessage("SQL_DATASOURCE_NULL"));
        }

        DataSource dataSource = DataSourceUtil.getDataSource(rawDataSource,
                pageContext);

        try {
            conn = dataSource.getConnection();
            origIsolation = conn.getTransactionIsolation();
            if (origIsolation == Connection.TRANSACTION_NONE) {
                throw new JspTagException(
                        Resources.getMessage("TRANSACTION_NO_SUPPORT"));
            }
            if ((isolation != Connection.TRANSACTION_NONE)
                    && (isolation != origIsolation)) {
                conn.setTransactionIsolation(isolation);
            }
            conn.setAutoCommit(false);
        } catch (SQLException e) {
            throw new JspTagException(
                    Resources.getMessage("ERROR_GET_CONNECTION",
                            e.toString()), e);
        }

        return EVAL_BODY_INCLUDE;
    }
1027615
@Override
  public void invoke(InboxAmp inbox, StubAmp actor)
  {
    Thread thread = Thread.currentThread();
    ClassLoader oldLoader = thread.getContextClassLoader();
    
    try {
      thread.setContextClassLoader(_loader);
      
      getDelegate().invoke(inbox, actor);
    } finally {
      thread.setContextClassLoader(oldLoader);
    }
  }
1089084
public void generateMethodExecuteTransaction(String daoFactory) {
		// create interface
		String transationExecutorName = "Transaction";
		// @formatter:off
		ParameterizedTypeName parameterizedTypeName = ParameterizedTypeName.get(className(AbstractExecutable.class),
				className(daoFactory));
		classBuilder.addType(TypeSpec.interfaceBuilder(transationExecutorName).addModifiers(Modifier.PUBLIC)
				.addSuperinterface(parameterizedTypeName).addJavadoc("Rapresents transational operation.\n")
				.addMethod(MethodSpec.methodBuilder("onExecute").addParameter(className(daoFactory), "daoFactory")
						.addJavadoc(
								"Execute transation. Method need to return {@link TransactionResult#COMMIT} to commit results\nor {@link TransactionResult#ROLLBACK} to rollback.")
						.addJavadoc("\nIf exception is thrown, a rollback will be done.")
						.addJavadoc("\n\n@param daoFactory\n@return\n@throws Throwable\n")
						.addModifiers(Modifier.PUBLIC, Modifier.ABSTRACT).returns(TransactionResult.class).build())
				.build());
		// @formatter:on

		{
			MethodSpec.Builder executeMethod = MethodSpec.methodBuilder("execute").addModifiers(Modifier.PUBLIC)
					.returns(Boolean.TYPE).addParameter(className(transationExecutorName), "transaction");
			// generate javadoc
			executeMethod.addJavadoc(
					"<p>Executes a transaction. This method <strong>is thread safe</strong> to avoid concurrent problems. The "
							+ "drawback is only one transaction at time can be executed. The database will be open in write mode. This method uses default error listener to intercept errors.</p>\n");
			executeMethod.addJavadoc("\n");
			executeMethod.addJavadoc("@param transaction\n\ttransaction to execute\n");
			executeMethod.addJavadoc("@return <code>true</code> if transaction successful finished\n");

			executeMethod.addStatement("return execute(transaction, onErrorListener)");

			classBuilder.addMethod(executeMethod.build());
		}

		{
			MethodSpec.Builder executeMethod = MethodSpec.methodBuilder("execute").addModifiers(Modifier.PUBLIC)
					.addParameter(className(transationExecutorName), "transaction").returns(Boolean.TYPE)
					.addParameter(className(OnErrorListener.class), "onErrorListener");

			executeMethod.addStatement("boolean needToOpened=!this.isOpenInWriteMode()");
			executeMethod.addStatement("boolean success=false");
			executeMethod.addCode("@SuppressWarnings(\"resource\")\n");
			executeMethod.addStatement("$T connection=needToOpened ? openWritableDatabase() : database()",
					SQLiteDatabase.class);

			// support for live data
			executeMethod.addStatement("$L currentDaoFactory=_daoFactorySingleThread.bindToThread()",
					DATA_SOURCE_SINGLE_THREAD_NAME);
			executeMethod.addStatement("currentDaoFactory.onSessionOpened()");

			executeMethod.beginControlFlow("try");
			executeMethod.addCode("connection.beginTransaction();\n");

			executeMethod.beginControlFlow(
					"if (transaction!=null && $T.$L == transaction.onExecute(currentDaoFactory))",
					TransactionResult.class, TransactionResult.COMMIT);
			executeMethod.addStatement("connection.setTransactionSuccessful()");

			// support for live data
			executeMethod.addStatement("success=true");

			executeMethod.endControlFlow();
			executeMethod.nextControlFlow("catch($T e)", Throwable.class);

			executeMethod.addStatement("$T.error(e.getMessage())", Logger.class);
			executeMethod.addStatement("e.printStackTrace()");
			executeMethod.addStatement("if (onErrorListener!=null) onErrorListener.onError(e)");

			executeMethod.nextControlFlow("finally");
			executeMethod.beginControlFlow("try");
			executeMethod.addStatement("connection.endTransaction()");
			executeMethod.nextControlFlow("catch ($T e)", Throwable.class);
			executeMethod.addStatement("$T.warn(\"error closing transaction %s\", e.getMessage())", Logger.class);
			executeMethod.endControlFlow();
			executeMethod.addCode("if (needToOpened) { close(); }\n");
			// support for live data
			executeMethod.addCode(
					"if (success) { currentDaoFactory.onSessionClosed(); } else { currentDaoFactory.onSessionClear(); }\n");
			executeMethod.endControlFlow();
			executeMethod.addStatement("return success");

			// generate javadoc
			executeMethod.addJavadoc(
					"<p>Executes a transaction. This method <strong>is thread safe</strong> to avoid concurrent problems. The "
							+ "drawback is only one transaction at time can be executed. The database will be open in write mode.</p>\n");
			executeMethod.addJavadoc("\n");
			executeMethod.addJavadoc("@param transaction\n\ttransaction to execute\n");
			executeMethod.addJavadoc("@param onErrorListener\n\terror listener\n");
			executeMethod.addJavadoc("@return <code>true</code> if transaction successful finished\n");

			classBuilder.addMethod(executeMethod.build());
		}

	}
985863
void performPostExecute() throws SQLException {

        resultOut.clearLobResults();

        generatedResult = null;

        if (resultIn == null) {
            return;
        }

        Result current = resultIn;

        while (current.getChainedResult() != null) {
            current = current.getUnlinkChainedResult();

            if (current.getType() == ResultConstants.WARNING) {
                SQLWarning w = Util.sqlWarning(current);

                if (rootWarning == null) {
                    rootWarning = w;
                } else {
                    rootWarning.setNextWarning(w);
                }
            } else if (current.getType() == ResultConstants.ERROR) {
                errorResult = current;
            } else if (current.getType() == ResultConstants.DATA) {
                generatedResult = current;
            }
        }

        if (resultIn.isData()) {
            currentResultSet = new JDBCResultSet(connection.sessionProxy,
                    this, resultIn, resultIn.metaData,
                    connection.connProperties);
        }
    }
864023
@Override
    protected void doExecute() throws Exception {
        final AnnotationHandler annotationHandler = getAnnotationHandler();

        final Set<Method> methods = findAnnotatedMethods(annotationHandler);

        final Map<String, FunctionConfiguration> configMap = getFunctionConfigurations(annotationHandler, methods);

        validateFunctionConfigurations(configMap);

        final ObjectWriter objectWriter = getObjectWriter();

        writeEmptyHostJsonFile(objectWriter);

        writeFunctionJsonFiles(objectWriter, configMap);

        copyJarsToStageDirectory();

        final CommandHandler commandHandler = new CommandHandlerImpl(this.getLog());
        final FunctionCoreToolsHandler functionCoreToolsHandler = getFunctionCoreToolsHandler(commandHandler);
        final Set<BindingEnum> bindingClasses = this.getFunctionBindingEnums(configMap);

        installExtension(functionCoreToolsHandler, bindingClasses);

        info(BUILD_SUCCESS);
    }
345656
@Override
	public void execute(SQLiteDatabase database, int previuosVersion, int currentVersion) {
		List<String> executionList=null;
	
		if (inputStream==null) {
			File f = new File(schemaDefinitionFile);
			executionList = SQLiteUpdateTaskHelper.readSQLFromFile(schemaDefinitionFile);
			Logger.info("Load DDL from " + f.getAbsolutePath());
		} else {
			executionList = SQLiteUpdateTaskHelper.readSQLFromFile(inputStream);
			Logger.info("Load DDL from stream");
		}
		
		for (String item : executionList) {
			Logger.info(item);
			database.execSQL(item);
		}

	}