Examples of registerSynchronization()


Examples of javax.transaction.Transaction.registerSynchronization()

         Transaction transaction = manager.getTransaction();
         if (transactions.isEmpty() || transactions.peek().equals(transaction))
         {
            transactions.push(transaction);
            synchronizations.push(new SynchronizationRegistry(beanManager));
            transaction.registerSynchronization(this);
         }
         synchronizations.peek().registerSynchronization(sync);
      }
      catch (Exception e)
      {
View Full Code Here

Examples of javax.transaction.Transaction.registerSynchronization()

        try {
            TransactionManager tm = TransactionFactory.getTransactionManager();
            if (tm != null && tm.getStatus() == STATUS_ACTIVE) {
                Transaction tx = tm.getTransaction();
                if (tx != null) {
                    tx.registerSynchronization(sync);
                }
            }
        } catch (RollbackException e) {
            //This is Java 1.4 only, but useful for certain debuggins: Throwable t = e.getCause() == null ? e : e.getCause();
            throw new GenericTransactionException("Roll Back error, could not register synchronization in transaction even though transactions are available, current transaction rolled back", e);
View Full Code Here

Examples of javax.transaction.Transaction.registerSynchronization()

                trans = tm.getTransaction();
            } else if (trans == null)
                return false;

            // synch broker and trans
            trans.registerSynchronization(broker);

            // we don't need to synchronize on brokers or guard against multiple
            // threads using the same trans since one JTA transaction can never
            // be active on multiple concurrent threads.
            Object txKey = mr.getTransactionKey();
View Full Code Here

Examples of javax.transaction.Transaction.registerSynchronization()

            Collection<Broker> brokers = _transactional.get(txKey);
           
            if (brokers == null) {
                brokers = new ArrayList<Broker>(2);
                _transactional.put(txKey, brokers);
                trans.registerSynchronization(new RemoveTransactionSync(txKey));
            }
            brokers.add(broker);
           
            return true;
        } catch (OpenJPAException ke) {
View Full Code Here

Examples of javax.transaction.Transaction.registerSynchronization()

        try {
            Transaction transaction = timerService.getTransactionManager().getTransaction();
            int status = transaction == null ? Status.STATUS_NO_TRANSACTION : transaction.getStatus();

            if (transaction != null && status == Status.STATUS_ACTIVE || status == Status.STATUS_MARKED_ROLLBACK) {
                transaction.registerSynchronization(new TimerDataSynchronization());
                synchronizationRegistered = true;
                return;
            }
        } catch (Exception e) {
            log.warning("Unable to register timer data transaction synchronization", e);
View Full Code Here

Examples of javax.transaction.Transaction.registerSynchronization()

                trans = tm.getTransaction();
            } else if (trans == null)
                return false;

            // synch broker and trans
            trans.registerSynchronization(broker);

            // we don't need to synchronize on brokers or guard against multiple
            // threads using the same trans since one JTA transaction can never
            // be active on multiple concurrent threads.
            Object txKey = mr.getTransactionKey();
View Full Code Here

Examples of javax.transaction.Transaction.registerSynchronization()

            Collection brokers = (Collection) _transactional.get(txKey);
           
            if (brokers == null) {
                brokers = new ArrayList(2);
                _transactional.put(txKey, brokers);
                trans.registerSynchronization(new RemoveTransactionSync(txKey));
            }
            brokers.add(broker);
           
            return true;
        } catch (OpenJPAException ke) {
View Full Code Here

Examples of javax.transaction.Transaction.registerSynchronization()

    if ( currentSession == null ) {
      currentSession = buildOrObtainSession();

      try {
        txn.registerSynchronization( buildCleanupSynch( txn ) );
      }
      catch ( Throwable t ) {
        try {
          currentSession.close();
        }
View Full Code Here

Examples of javax.transaction.Transaction.registerSynchronization()

    if ( currentSession == null ) {
      currentSession = buildOrObtainSession();

      try {
        txn.registerSynchronization( buildCleanupSynch( txnIdentifier ) );
      }
      catch ( Throwable t ) {
        try {
          currentSession.close();
        }
View Full Code Here

Examples of javax.transaction.Transaction.registerSynchronization()

    if ( currentSession == null ) {
      currentSession = buildOrObtainSession();

      try {
        txn.registerSynchronization( buildCleanupSynch( txnIdentifier ) );
      }
      catch ( Throwable t ) {
        try {
          currentSession.close();
        }
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.