File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how i can specify transaction isolation level in ejb3?

 
raminaa niilian
Ranch Hand
Posts: 551
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<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
Posts: 2
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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


 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic