It's not a secret anymore!
The moose likes EJB and other Java EE Technologies and the fly likes Transaction Isolation 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 "Transaction Isolation" Watch "Transaction Isolation" New topic

Transaction Isolation

Jim Clayson

Joined: Mar 14, 2000
Posts: 7
Tomcat3.2.3+Jboss2.4.1 on SuSE Linux 7.2(kernel 2.4.13), jdk1.3.1_01 against PostgreSQL 7.0
Can someone please clarify or summarize (or point out a relevent reference) the nature of transaction isolation in EJB.(ejb spec 1.1 or 2.0)
I've heard people use the term 'transaction isolation' and I've heard people talk about a transaction isolation level being set on an SQL connection. I think it is really critical to understand what the J2EE-compliant container guarantees in terms of its transactional behaviour.
And the question/s is/are:
1. What exactly is being isolated?
2. From what is it being isolated?
3. When does the isolation begin and end?(What determines the duration of the isolation?)
I'm currently looking for answers in the ejb spec (2.0) so I'll be sure to report back when I find any.
JeanLouis Marechaux
Ranch Hand

Joined: Nov 12, 2001
Posts: 906
The isolation level is a DB stuff.
It's a transaction attribute
If it is mentioned when you use EJB, it is because the cantainer is supposed to manage transactions for you.
So it sppecifies the isolation level the EJB container will set during a transaction with a DB.
As far as I remember, there are 4 isolation levels in the spec.
1- None (the default) . No isolation
2- Read uncommited : prevent from dirty reads, ie read data that are not commited by another transaction
3- Repeatable read : prevent from unreapeatable reads, ie, if you read the same data twice, you do not obtain the same value cause another transaction has changed it
4- Serializable : prevent from phantom read, ie, the same SQL statement does not returns the same result set cause another transaction has added/deleted data

/ JeanLouis<br /><i>"software development has been, is, and will remain fundamentally hard" (Grady Booch)</i><br /> <br />Take a look at <a href="" target="_blank" rel="nofollow">Agile OpenUP</a> in the Eclipse community
I agree. Here's the link:
subject: Transaction Isolation
It's not a secret anymore!