Calling db.begin() and db.commit() is simply managing the transaction. However, by explicitly overriding the transaction manager, that functionality is handled by the app server's TxMngr.
******************************************** Steve Ebersole IT Integration Engineer Vignette Corporation 512.741.4195 Visit http://www.vignette.com ******************************************** -----Original Message----- From: Gray Jones [mailto:[EMAIL PROTECTED]] Sent: Friday, March 22, 2002 1:55 PM To: [EMAIL PROTECTED] Subject: Re: [castor-dev] Using Castor in a BMP entity bean Would I still need to call begin() and commit()? Or would that be handled by the jta transaction manager? Thanks! -----Original Message----- From: Ebersole, Steven [mailto:[EMAIL PROTECTED]] Sent: Friday, March 22, 2002 2:51 PM To: [EMAIL PROTECTED] Subject: Re: [castor-dev] Using Castor in a BMP entity bean When setting up the JDO object, do the following call: JDO _jdo = new JDO(); ... _jdo.setTransactionManager( "javax/transaction/TransactionManager" ); Then, just get a UserTransaction object from JNDI (or not if the container will be managing the transaction). UserTransaction ut = new InitialContext().lookup( "javax/transaction/UserTransaction" ); if (ut.getStatus()==Status.STATUS_NO_TRANSACTION) { log.debug( "Transaction was idle after get, starting" ); ut.begin(); } Database db = _jdo.getDatabase(); //...perform persistence... ut.commit(); db.close(); ******************************************** Steve Ebersole IT Integration Engineer Vignette Corporation 512.741.4195 Visit http://www.vignette.com ******************************************** -----Original Message----- From: Gray Jones [mailto:[EMAIL PROTECTED]] Sent: Friday, March 22, 2002 12:40 PM To: [EMAIL PROTECTED] Subject: [castor-dev] Using Castor in a BMP entity bean Can anybody point me to where I can find information about how to use castor in a bean managed entity bean? I don't see how I can connect castor to use the app server's (jBoss) transaction management. Also i'm assuming that if I was able to get castor to use the transactions from the app server, then I shouldn't be calling commit() from within the castor related code. right? Thanks, Gray Jones ----------------------------------------------------------- If you wish to unsubscribe from this mailing, send mail to [EMAIL PROTECTED] with a subject of: unsubscribe castor-dev ----------------------------------------------------------- If you wish to unsubscribe from this mailing, send mail to [EMAIL PROTECTED] with a subject of: unsubscribe castor-dev ----------------------------------------------------------- If you wish to unsubscribe from this mailing, send mail to [EMAIL PROTECTED] with a subject of: unsubscribe castor-dev ----------------------------------------------------------- If you wish to unsubscribe from this mailing, send mail to [EMAIL PROTECTED] with a subject of: unsubscribe castor-dev
