OW2 Consortium
Search OW2 Mail Archive: 

Advanced Search - Powered by Google


Mail Archive Home | jotm List | October 2006 Index

<--  Date Index  --> <--  Thread Index  -->

Re: [jotm] JOTM and standalone POJOS


Sudhi Seshachala wrote:

Yes I understand.
For testing purpose, I am "NOT" doing a jndi lookup for JOTM.
all I am doing is Instantiating JOTM.
as in
// creates an instance of JOTM with a local transaction factory which is not bound to a registry
jotm = new Jotm(true, false);


TransactionFactory getInstance().getUserTransaction() returns a userTransaction and that is pretty.

suppose when I move to app, I can configure jndi context using context.xml TOMCAT. But for testing purpose Can I go this route ? Am I clean now ?

As far as I know, the transaction you obtain this way is attached to the current thread (it is a global variable in the ThreadLocal, I think...). So, if you use multiple transactions in the same thread, make sure not to nest them (eg. do not call begin() twice before you have committed, rolled back or suspended the transaction).

Otherwise, you will have to dig into JOTM's internal APIs to create new transactions, which will not be attached to the current thread (I don't believe this is exposed in the external APIs).

Regards,
Pierre-Yves Gibello - ExperLog




<--  Date Index  --> <--  Thread Index  -->

Reply via email to:

Powered by MHonArc.

Copyright © 2006-2007, OW2 Consortium | contact | webmaster.