dcsimg
J2EE - Isolation levels and UserTransaction object
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Colin_Saxton
Posted On:   Wednesday, April 2, 2003 01:44 AM

I am slighlty confused as to what point I can set an isolation level when using a UserTransaction object... 1. From within a servlet I gain a reference to a UserTransaction instance using JNDI. 2. I now start the transaction. 3...run some code.. 4. Retreive a datasource using JNDI and get a connection off the datasource. 5. I now set the isolation on the connection before executing any commands against it. 6...more code... 7. I repeat steps 4 to 6 on a different datasource. 8. I now commit the user transaction...which in turn should commit all of the outstanding transactions against all of    More>>


I am slighlty confused as to what point I can set an isolation level when using a UserTransaction object...


1. From within a servlet I gain a reference to a UserTransaction instance using JNDI.


2. I now start the transaction.


3...run some code..


4. Retreive a datasource using JNDI and get a connection off the datasource.


5. I now set the isolation on the connection before executing any commands against it.


6...more code...


7. I repeat steps 4 to 6 on a different datasource.


8. I now commit the user transaction...which in turn should commit all of the outstanding transactions against all of the connections used.


I have tested this from within a servlet and all seems to work fine but when I read anything about isolation levels and when to set them it seems very patchy when using them in conjunction with a UserTransaction object. Any information in this area would be greatly appreciated...


Thanks, Colin.

   <<Less

Re: J2EE - Isolation levels and UserTransaction object

Posted By:   Les_Jones  
Posted On:   Friday, April 4, 2003 02:15 AM

Interesting that no-one has replied to this in 2 days. Does nobody understand how transactions work in J2EE!?

Perhaps Sun should take note. ;-)
About | Sitemap | Contact