This content has been marked as final.
Show 6 replies
-
1. Re: UserTransactedStartedListener is not implemented in EJB3
adrian.brock Jul 2, 2007 6:35 AM (in response to adrian.brock)I think the way this does is pretty bad.
It requires each UserTransaction to implement a static method
to inject the transaction started listener//Registration for CachedConnectionManager so our UserTx can notify //on tx started. private static ServerVMClientUserTransaction.UserTransactionStartedListener tsl; /** * The <code>setUserTransactionStartedListener</code> method is called by * CachedConnectionManager on start and stop. The tsl is notified on * UserTransaction.begin so it (the CachedConnectionManager) can enroll * connections that are already checked out. * * @param newTsl a <code>ServerVMClientUserTransaction.UserTransactionStartedListener</code> value */ public static void setUserTransactionStartedListener(ServerVMClientUserTransaction.UserTransactionStartedListener newTsl) { tsl = newTsl; }
Then the cached connection manager (CCM) needs to know about all listeners:protected void startService() throws Exception { tm = (TransactionManager) getServer().getAttribute(transactionManagerServiceName, "TransactionManager"); TransactionSynchronizer.setTransactionManager(tm); ServerVMClientUserTransaction.getSingleton().registerTxStartedListener(this); EnterpriseContext.setUserTransactionStartedListener(this); }
It would be much better if the CCM had a single place to register the listener
and then each UserTransaction notified that single place of transaction start. -
2. Re: UserTransactedStartedListener is not implemented in EJB3
adrian.brock Jul 2, 2007 6:37 AM (in response to adrian.brock)NOTE: The embedded UserTransactions has the same problem.
-
3. Re: UserTransactedStartedListener is not implemented in EJB3
wolfc Aug 8, 2007 10:49 AM (in response to adrian.brock)http://jira.jboss.com/jira/browse/EJBTHREE-1028
I'll ignore the embedded user transaction for the moment. It will either be removed or deprecated. -
4. Re: UserTransactedStartedListener is not implemented in EJB3
wolfc Nov 25, 2008 6:14 AM (in response to adrian.brock)Why is EJB2UserTransactionProvider not part of the transaction-spi?
Shouldn't the EJB2UserTransactionProvider bean define a dependency on the UserTransactionRegistry? -
5. Re: UserTransactedStartedListener is not implemented in EJB3
adrian.brock Nov 25, 2008 7:32 AM (in response to adrian.brock)"wolfc" wrote:
Why is EJB2UserTransactionProvider not part of the transaction-spi?
Shouldn't the EJB2UserTransactionProvider bean define a dependency on the UserTransactionRegistry?
No its an incallback.<bean name="UserTransactionRegistry" class="org.jboss.tm.usertx.UserTransactionRegistry"> THIS REGISTERS ALL USER TRANSACTION PROVIDERS <!-- Register providers --> <incallback method="addProvider"/> <uncallback method="removeProvider"/> THIS REGISTERS THE LISTENERS (Currently only the CCM) <!-- Register listeners --> <incallback method="addListener"/> <uncallback method="removeListener"/> </bean>
That way you can remove the ejb and jca configs without having to redo
the other configurations. -
6. Re: UserTransactedStartedListener is not implemented in EJB3
wolfc Nov 25, 2008 9:12 AM (in response to adrian.brock)So the moment UserTransactionRegistry comes online all already installed providers are also added?