@Override protected void registerSynchronization_impl(AbstractSynchronizationListener listener, Object txn) throws Exception { final TransactionImpl transaction = (TransactionImpl) txn; final Synchronization synchronization = (Synchronization) listener; transaction.registerInterposedSynchronization(synchronization); } }
/** * jta 1.1 method so the jpa implementations can be told to flush their caches. * @param synchronization */ public void registerInterposedSynchronization(Synchronization synchronization) { TransactionImpl tx = getActiveTransactionImpl(); tx.registerInterposedSynchronization(synchronization); }
/** * jta 1.1 method so the jpa implementations can be told to flush their caches. * @param synchronization */ public void registerInterposedSynchronization(Synchronization synchronization) { TransactionImpl tx = getActiveTransactionImpl(); tx.registerInterposedSynchronization(synchronization); }
/** * jta 1.1 method so the jpa implementations can be told to flush their caches. * @param synchronization interposed synchronization */ public void registerInterposedSynchronization(Synchronization synchronization) { TransactionImpl tx = getActiveTransactionImpl(); tx.registerInterposedSynchronization(synchronization); }
/** * jta 1.1 method so the jpa implementations can be told to flush their caches. * @param synchronization */ public void registerInterposedSynchronization(Synchronization synchronization) { TransactionImpl tx = getActiveTransactionImpl(); tx.registerInterposedSynchronization(synchronization); }
public static ConnectorTransactionContext get(Transaction transaction) { if (transaction == null) { throw new NullPointerException("transaction is null"); } ConnectorTransactionContext ctx = DATA_INDEX.get(transaction); if (ctx == null) { ctx = new ConnectorTransactionContext(); try { int status = transaction.getStatus(); if (status != Status.STATUS_COMMITTED && status != Status.STATUS_ROLLEDBACK && status != Status.STATUS_UNKNOWN) { ((TransactionImpl)transaction).registerInterposedSynchronization(new ConnectorSynchronization(ctx, transaction)); // Note: no synchronization is necessary here. Since a transaction can only be associated with a single // thread at a time, it should not be possible for someone else to have snuck in and created a // ConnectorTransactionContext for this transaction. We still protect against that with the putIfAbsent // call below, and we simply have an extra transaction synchronization registered that won't do anything DATA_INDEX.putIfAbsent(transaction, ctx); } // } catch (RollbackException e) { // throw (IllegalStateException) new IllegalStateException("Transaction is already rolled back").initCause(e); } catch (SystemException e) { throw new RuntimeException("Unable to register ejb transaction synchronization callback", e); } } return ctx; }