wood burning stoves 2.0*
The moose likes EJB and other Java EE Technologies and the fly likes how i can specify transaction isolation level in ejb3? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "how i can specify transaction isolation level in ejb3?" Watch "how i can specify transaction isolation level in ejb3?" New topic
Author

how i can specify transaction isolation level in ejb3?

raminaa niilian
Ranch Hand

Joined: Jul 14, 2005
Posts: 551
Hi
Thank you for reading my post.
how i can specify transaction isolation leve in ejb3 ?
for example :




the above code will make sure that my method will execute in context of a transaction, but how we can determine transaction level?

for example read commited?
thanks.
Abhisankar Mahanta
Greenhorn

Joined: Aug 04, 2009
Posts: 2
<CODE>

2. // use the default Isolation level.

3. // Likely to be READ_COMMITTED

4. //Ebean.beginTransaction();

5.

6. // start a transaction at SERIALIZABLE

7. Ebean.beginTransaction(Transaction.SERIALIZABLE);

8. ...

9. </CODE>

Abhisankar Mahanta
Greenhorn

Joined: Aug 04, 2009
Posts: 2
the above examle shows how you can set isolation level through EBeans

in ejb3 it is not possible to set isolation level programatically if you are using connection pooling,to set refer your servers Docs
if you are not using connection pooling then you can set isolation levels programatically like this

Connection conn=DriverManager.getConnection("URL");
conn.setTransactionLevel(int level);

level 1:READ_UNCOMMITTED

level 2:READ_COMMITTED

level 3:REPEATABLE_READ

level 4:SERIALIZABLE


 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how i can specify transaction isolation level in ejb3?