private void associate(TransactionImpl tx) throws InvalidTransactionException { if (tx == null) throw new NullPointerException("tx is null"); Object existingAssociation = associatedTransactions.putIfAbsent(tx, Thread.currentThread()); if (existingAssociation != null) { throw new InvalidTransactionException("Specified transaction is already associated with another thread"); } threadTx.set(tx); fireThreadAssociated(tx); activeCount.getAndIncrement(); }
private void associate(TransactionImpl tx) throws InvalidTransactionException { if (tx.getStatus() == Status.STATUS_NO_TRANSACTION) { throw new InvalidTransactionException("Cannot resume invalid transaction: " + tx); } else { Object existingAssociation = associatedTransactions.putIfAbsent(tx, Thread.currentThread()); if (existingAssociation != null) { throw new InvalidTransactionException("Specified transaction is already associated with another thread"); } threadTx.set(tx); fireThreadAssociated(tx); activeCount.getAndIncrement(); } }
private void associate(TransactionImpl tx) throws InvalidTransactionException { if (tx.getStatus() == Status.STATUS_NO_TRANSACTION) { throw new InvalidTransactionException("Cannot resume invalid transaction: " + tx); } else { Object existingAssociation = associatedTransactions.putIfAbsent(tx, Thread.currentThread()); if (existingAssociation != null) { throw new InvalidTransactionException("Specified transaction is already associated with another thread"); } threadTx.set(tx); fireThreadAssociated(tx); activeCount.getAndIncrement(); } }
private void associate(TransactionImpl tx) throws InvalidTransactionException { if (tx.getStatus() == Status.STATUS_NO_TRANSACTION) { throw new InvalidTransactionException("Cannot resume invalid transaction: " + tx); } else { Object existingAssociation = associatedTransactions.putIfAbsent(tx, Thread.currentThread()); if (existingAssociation != null) { throw new InvalidTransactionException("Specified transaction is already associated with another thread"); } threadTx.set(tx); fireThreadAssociated(tx); activeCount.getAndIncrement(); } }