Examples of TransactionListener


Examples of org.uengine.kernel.TransactionListener

    if(valueMap==null) valueMap = new HashMap();
    if(value==null) valueMap.remove(fieldName);
    valueMap.put(fieldName, value);
   
    if(!instance.getProcessTransactionContext().getTransactionListeners().contains(this))
      instance.getProcessTransactionContext().addTransactionListener(new TransactionListener(){

        public void beforeCommit(TransactionContext tx) throws Exception {
          saveValueMap();
        }
View Full Code Here

Examples of org.uengine.kernel.TransactionListener

     
      String sharedContextKey = tableName + "@" + keyFieldValue;
      sharedContextKey = sharedContextKey.toUpperCase();
     
      setSharedContext(sharedContextKey, dao);
      addTransactionListener(new TransactionListener(){

        public void beforeCommit(TransactionContext tx) throws Exception {
          if(isNew)
            dao.getImplementationObject().createInsertSql();
          else
View Full Code Here

Examples of org.uengine.kernel.TransactionListener

   
    ForLoop beforeCommitLoop = new ForLoop(){

      public void logic(Object target) {
       
        TransactionListener tl = (TransactionListener)target;
        try {
          tl.beforeCommit(tx);
        } catch (Exception e) {
          throw new RuntimeException(e);
        }       
      }     
    };
View Full Code Here

Examples of org.uengine.kernel.TransactionListener

    ForLoop afterCommitLoop = new ForLoop(){

      public void logic(Object target) {

        TransactionListener tl = (TransactionListener)target;
        try {
          tl.afterCommit(tx);
        } catch (Exception e) {
          throw new RuntimeException(e);
        }       
      }     
    };
View Full Code Here

Examples of org.uengine.kernel.TransactionListener

    ForLoop afterRollBackLoop = new ForLoop(){

      public void logic(Object target) {

        TransactionListener tl = (TransactionListener)target;
        try {
          tl.afterRollback(tx);
        } catch (Exception e) {
          throw new RuntimeException(e);
        }       
      }     
    };
View Full Code Here

Examples of org.uengine.kernel.TransactionListener

    ForLoop beforeRollBackLoop = new ForLoop(){

      public void logic(Object target) {

        TransactionListener tl = (TransactionListener)target;
        try {
          tl.beforeRollback(tx);
        } catch (Exception e) {
          throw new RuntimeException(e);
        }       
      }     
    };
View Full Code Here

Examples of org.uengine.kernel.TransactionListener

        con.setAutoCommit(false);
         
        setSharedContext(sharedContextName, con);
 
        addTransactionListener(
          new TransactionListener(){
 
            public void beforeCommit(TransactionContext tx) throws Exception {
              Connection con = (Connection)tx.getSharedContext(sharedContextName);
              try{
                con.commit();
View Full Code Here

Examples of org.uengine.kernel.TransactionListener

   
    if(!dao.getImplementationObject().isAutoSQLGeneration()){ //'isAutoSQLGeneration()' was simply used for flagging whether a transaction listener has been attached.
      final IDAO finalDAO = dao;
      dao.set(getCorrelationFieldName(), ((EJBProcessInstance)instance).getProcessInstanceDAO().get(getCorrelatedFieldName()));
     
      instance.getProcessTransactionContext().addTransactionListener(new TransactionListener(){

        public void beforeCommit(TransactionContext tx) throws Exception {
          finalDAO.getImplementationObject().setTableName(getTableName());
          finalDAO.getImplementationObject().setSqlStmt(null);
          finalDAO.getImplementationObject().setAutoSQLGeneration(true);
View Full Code Here

Examples of org.uengine.kernel.TransactionListener

        if (instance != null) {
         
          if (item.getInstanceIsDeleted() == 0) {
            if (item.getStartDate().getTime() <= now.getTimeInMillis()) {
             
              instance.getProcessTransactionContext().addTransactionListener(new TransactionListener() {
               
                public void beforeRollback(TransactionContext tx) throws Exception {
                }
               
                public void beforeCommit(TransactionContext tx) throws Exception
View Full Code Here

Examples of org.xtreemfs.babudb.api.transaction.TransactionListener

        final AtomicInteger count = new AtomicInteger(0);
       
        DatabaseManager dbMan = database.getDatabaseManager();
       
        // add a transaction listener
        TransactionListener l0 = new TransactionListener() {
            public void transactionPerformed(Transaction txn) {
                count.incrementAndGet();
            }
        };
        dbMan.addTransactionListener(l0);
       
        // create and execute a transaction
        Transaction txn = dbMan.createTransaction();
        txn.createDatabase("test", 1);
        txn.insertRecord("test", 0, "hello".getBytes(), "world".getBytes());
        txn.insertRecord("test", 0, "key".getBytes(), "value".getBytes());
        dbMan.executeTransaction(txn);
       
        assertEquals(1, count.get());
       
        // create and execute another transaction (which is empty)
        txn = dbMan.createTransaction();
       
        // add a listener before executing the transaction and wait for the
        // notification
        TransactionListener l1 = new TransactionListener() {
            public void transactionPerformed(Transaction txn) {
                count.incrementAndGet();
            }
        };
        dbMan.addTransactionListener(l1);
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.