Thank you very much Werner,
 
I investigated on my side and I found that I can
get the transaction on my thread via the method :

com.ibm.ejs.jts.jta.JTSXA.getTransactionManager();

I added this in my JDO and now it works :o)

Indeed I'm waiting for the next release of castor :o)

For the discussion on the datasource I don't understand

how it shoul work. It looks like the datasource that I lookup

from my jndi context is actually associate with the transaction.

I made a test, creating a record without begin and commit on the

connection that I get from the datasource and at the end of

the transaction, the record was create ..... It means that my

connection was associate with the transaction no ???????

Thanks

 

Christophe

 

 



Werner Guttmann <[EMAIL PROTECTED]> wrote:
Christophe,

please see inline ...

Werner

--Original Message Text---
From: Christophe Frey
Date: Wed, 10 Sep 2003 15:44:50 +0200 (CEST)

Thankks to answer so quickly !!!!

But I don't understand how it should work.

1. The datasource that I look up is already associate
with a Transaction so why must I register the JDO
with the transaction

werner --> That's actually a statement which is partly right and partly wrong. It is not true that the DataSource is *associated* with a transaction when you look it up. Your DataSource (assuming it's an instance of XADataSource or a similar class) is a class that is capable of being part of a distributed (XA-enabled) transaction, but that's it. In other words, because of this, it can be part of a distrubuted transaction that is managed by a transaction manager, e.g. WebSphere's transaction coordinator. But once again, it is *NOT* associated with a transaction.

2 . How can I know the jndi name of my container
manage transaction in Websphere 4 (I don't even
know that such a thing was possible for a
container manage transaction :o( )

werner --> Oops, forgot to add this in my original reply. Unfortunately, the answer is a bit complicated. But here we go: as almosst always, IBM with WebSphere has decided to not expose the transaction manager via a naming and directory service such as JNDI, but only in a custom-way. In other words, I could send you a patch which you'd have to apply against the Castor sources and build Castor yourself (which is what I did in my previous job at msdw). Though if you happen to have some time at your fingers (a couple of weeks), please be patient and wait for (I think) the next release. I've submitted a (quite elaborate) patch a couple of days ago that in the end is a complete rewrite of how Castor interacts with transaction managers. And this new module will have support for Websphere 4 and 5 out of the box.


Thanks

Christophe

Werner Guttmann <[EMAIL PROTECTED]> wrote:
Christophe,

as you are using WebSphere 4, did you instruct Castor about the fact that you are deploying your application on a web/ejb container and that you want to use container-managed transactions. All this can be done by calling

JDO.setTransactionManager()

and providing the JNDI ENC of the transaction manager.

If you have not done so, the TransactionNotInProgressException signals that a transactrion has not been started yet, and Castor requires a transaction in progress before you can create/load/update objects. This can either be achieved by starting a (local) transaction manually (Database.begin()), running your ejb app with container-managed transactions enabled or using the UserTransaction interface to control transaction demarcation yourself.

I hope ! this helps ...

Werner

--Original Message Text---
From: Christophe Frey
Date: Tue, 9 Sep 2003 22:51:59 +0200 (CEST)



I'm trying to test castor with websphere 4 and I can't make it work in my

container manage transaction. I've create a new Datasource test

in my whebsphere instance, when in test it directly it works fine.

Now when I try to associate use it with castor the problem begin :o(

First I have create my database an mapping file.

My database file contains an element jndi with

the name of the jndi name of the datasource for attribute.

When I try to create a new Object in my database the method

DatabaseImpl.getTransaction throw a

TransactionNotInProgressException ????

Did I make something wrong ???? (My transaction is ! container manage ...)

It works fine when I use directly the datasource !!!!!!!

The BD is an Oracle 8i instance.

The datasource is a oracle.jdbc.pool.OracleConnectionPoolDataSource class.

Thanks to help me.



Christophe Frey



Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en fran�ais !
Testez le nouveau Yahoo! Mail>







Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en fran�ais !
Testez le nouveau Yahoo! Mail





Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en fran�ais !
Testez le nouveau Yahoo! Mail

Reply via email to