• Post Reply Bookmark Topic Watch Topic
  • New Topic

EJB and Isolation Level  RSS feed

 
JeanLouis Marechaux
Ranch Hand
Posts: 906
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
According to you, what is the defaultisolation level an architect should recommend for an EJB layer (for a RDMS data source)
- Uncommited
- Commited
- Repeatable
- Serializable
By default, I mean the level to use most of the time, allowing of course to change it upon specific needs.
 
JeanLouis Marechaux
Ranch Hand
Posts: 906
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As far as I understand Ed Roman's point of view in the mastering EJB II book, the Serializable mode is the one to use by default.
It's better to be safe than sorry.
What about you Gurus ??
 
Kyle Brown
author
Ranch Hand
Posts: 3892
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not surprisingly, I agree with Ed. I only drop down to a less-safe isolation level if performance problems dictate it.
Kyle
[ February 22, 2002: Message edited by: Kyle Brown ]
 
JeanLouis Marechaux
Ranch Hand
Posts: 906
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No surprisingly, it seems it is a controversial subject.
In the java server programming 1.3 book (wrox), the defautl level, according to them, should be..... Read_Commited
 
Kyle Brown
author
Ranch Hand
Posts: 3892
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yeah, well and Richard Monson-Haefel says in his book "it depends".
What we're talking about is an effect on both data consistency and performance. I personally feel that the data consistency issues are important enough that I put it up at Serializable. Only if performance is an issue, and I can demonstrate that nothing will be harmed by a lower level do I drop it down. What exactly do the Wrox guys say about it?
Kyle
 
JeanLouis Marechaux
Ranch Hand
Posts: 906
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
From Wrox guys... (It is anonymous, but I guess Cedric Beust is responsible for the EJB part)
The isolation level TRANSACTION_READ_COMMITED prevents dirty reads, but allows non-repeatable and phantoms reads.
Although any decision about isolation level should take into account application data integrity requirements, the target database and performance and scaling needs,a simple generic recommandation for many situation is to use this isolation level
 
amit indian
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi friends , i have been reading about this issue lately and what i ahve concluded is it all depends.
if u r sure that ur critical data is not shared , i mean to users wont write on same row then u should surely use read_commited , as in our project this is the case so we use read_commited.
forget the nonrepetable and phantom reads as i have never come accross any such method , where u r reading the same data twice !!!
as far as performance goes , we have done thorugh tests (concurrency and total hits) and reached the conclusion that read_commited gives far far better performance then serilizable . as the later locks the method (in a particular fashion)
iam actually beginning to hate serilaizable now(lol, joking)
i guess what ever i ahve written makes sense, lol

i woule love to discuss on this topic .
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!