So I could do something like the following?

JDO jdo = ...
Database db = jdo.getDatabase();
boolean inheritTx = db.isActive();
if (!inheritTx) db.begin();

...

if (!inheritTx) db.commit();
db.close();


Thanks,
Bob

Bruce Snyder wrote:
> This one time, at band camp, Bob Lee said:
> 
> BL>Does anyone know the best way to check if you are currently running in a 
> BL>tx? (assuming EJB, container-managed tx.)
> BL>
> BL>I would assume that the Castor code is already doing this somewhere.
> 
> Bob,
> 
> If you just want to know if a Castor transaction is active,
> org.exolab.castor.jdo.Database.isActive() can be used for this. OTOH, if you
> want the transactional state from the container, Werner is correct. 
> 
> Bruce

----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-dev

Reply via email to