Package org.jbpm.tx

Examples of org.jbpm.tx.StandardTransaction


    if (tx) {
      log.finest("beginning hibernate transaction");
      org.hibernate.Transaction hibernateTransaction = session.beginTransaction();
     
      // get the standard-transaction
      StandardTransaction standardTransaction = null;
      if (standardTransactionName!=null) {
        standardTransaction = (StandardTransaction) wireContext.get(standardTransactionName);
      } else {
        standardTransaction = wireContext.get(StandardTransaction.class);
      }
      if (standardTransaction==null) {
        throw new WireException("couldn't find standard-transaction "+(standardTransactionName!=null ? "'"+standardTransactionName+"'" : "by type ")+"to enlist the hibernate transaction");
      }

      // enlist the hibernate transaction to the global transaction
      HibernateTransactionResource resource = new HibernateTransactionResource(hibernateTransaction, session);
      standardTransaction.enlistResource(resource);
    }

    // make sure that the session is closed when the context closes.
    // method event will be called (see below)
    wireContext.addListener(new SessionCloser(session));
View Full Code Here


public class StandardTransactionDescriptor extends AbstractDescriptor {

  private static final long serialVersionUID = 1L;

  public Object construct(WireContext wireContext) {
    StandardTransaction standardTransaction = new StandardTransaction();
    Environment environment = wireContext.getEnvironment();
    if (environment==null) {
      throw new WireException("standard transaction requires environment");
    }
    standardTransaction.setEnvironment(environment);
    wireContext.addListener(standardTransaction);
    return standardTransaction;
  }
View Full Code Here

         || (! (object instanceof StandardTransaction))
       ) {
      throw new WireException("couldn't find "+StandardTransaction.class.getName()+" "+(transactionName!=null ? "'"+transactionName+"'" : "by type")+" to enlist resource "+target);
    }

    StandardTransaction standardTransaction = (StandardTransaction) object;

    log.finest("enlisting resource "+target+" with transaction");
    standardTransaction.enlistResource((Resource)target);
  }
View Full Code Here

TOP

Related Classes of org.jbpm.tx.StandardTransaction

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.