OK, forget my question cause all you need is to add the TransactionManager to the JNDI tree in order to make Castor find it.
If you're running a WAS 4 server, take a look at this message :

http://castor.exolab.org/list-archive/msg19375.html

Thanks Mickael ;o)




From: "Cdrick Laballery" <[EMAIL PROTECTED]>
Reply-To: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: [castor-dev] Transactions in a J2EE context
Date: Tue, 03 Dec 2002 15:47:50 +0000

Hi all,
in the "Using JDO" part of the online documentation, I can see the following example :

InitialContext ctx;
UserTransaction ut;
Database db;
// Lookup databse in JNDI
ctx = new InitialContext();
db = (Database) ctx.lookup( "java:comp/env/jdo/mydb" );
// Begin a transaction
ut = (UserTransaction) ctx.lookup( "java:comp/UserTransaction" );
ut.begin();
// Do something
. . .
// Commit the transaction, close database
ut.commit();
db.close();

Unfortunately, when I try to write this kind of code in my webapp running under WAS 4, the first call to a db operation throws a "org.exolab.castor.jdo.TransactionNotInProgressException: No transaction in progress for the current thread"

I've seen that the source code of JDO::getDatabase() tries to retrieve a javax.transaction.Transaction from a javax.transaction.TransactionManager that doesn't exist in the JNDI tree of my application server.

So, does anyone have any clue on how I can use user managed transactions in a J2EE context ?
Will I have to modify JDO and DatabaseImpl classes as said in the following thread: http://www.mail-archive.com/[email protected]/msg08236.html ?
And by the way, does the given example work with any application server ?

TIA

C�drick

_________________________________________________________________
MSN Messenger : discutez en direct avec vos amis ! http://www.msn.fr/msger/default.asp

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

_________________________________________________________________
MSN Search, le moteur de recherche qui pense comme vous ! http://search.msn.fr/worldwide.asp

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

Reply via email to