Hi!
Aaron Mulder wrote:
> A question about the JNDI context. When someone checks an
> XAConnection out of the pool, it needs to register with the
> TransactionManager. It gets a handle to the TransactionManager via a
> JNDI lookup.
The JNDI binding of the txman is NYI, but it's easy to do. Will fix.
All: any suggestion on which JNDI-name to use? "TransactionManager"?
> I've seen on the list that you can create an InitialContext
> from which to do a lookup simply with new InitialContext() if your
> configuration files are placed appropriately.
Correct.
> First, does this also work on the server side? I think everyone's
> been asking about client use so far.
Yup, works, same thing.
> And second, will this work correctly? It looks like the current
> Transaction is stored in a ThreadLocal, so any time you get the
> TransactionManager from JNDI it will return the same one, but when it goes
> to look up the Transaction it will find the correct ThreadLocal one. Just
> want to make sure I'm not missing some subtlety that would cause me to
> have to load a specific context somehow to get the correct transaction.
The current TransactionManager is stateless, so doing new TxMan() lots
of times will be no problem (as you note the tx's are stored in a static
threadlocal).
This might change though. The JNDI lookup is the most future-compliant
way to access it.
/Rickard
--
Rickard �berg
@home: +46 13 177937
Email: [EMAIL PROTECTED]
http://www.telkel.com
http://www.jboss.org
http://www.dreambean.com