users@glassfish.java.net

Re: how to obtain a TransactionManager in a servlet?

From: <glassfish_at_javadesktop.org>
Date: Fri, 20 Apr 2007 13:09:03 PDT

If java:appserver/TransactionManager is not the correct interface for developers to use to get the transaction manager, the documentation should probably be updated to reflect that.

From the SJAS 9.1 Developer Guide linked off the Glassfish documentation page:

TheTransaction Manager, theTransaction Synchronization
Registry, and UserTransaction

You can access the Application Server transaction manager, a javax.transaction.TransactionManager implementation, using the JNDI subcontext java:comp/TransactionManager or java:appserver/TransactionManager.

You can access the Application Server transaction synchronization registry, a javax.transaction. TransactionSynchronizationRegistry implementation, using the JNDI subcontext java:comp/TransactionSynchronizationRegistry or java:appserver/
TransactionSynchronizationRegistry.

You can also request injection of a TransactionManager or TransactionSynchronizationRegistry object using the @Resource annotation. Accessing the transaction synchronization registry is recommended.

For details, see Java Specification Request (JSR) 907 (http://www.jcp.org/en/jsr/detail?id=907).
[Message sent by forum member 'areplogle' (areplogle)]

http://forums.java.net/jive/thread.jspa?messageID=213467