persistence@glassfish.java.net

Re: Transaction isolation control

From: Marina Vatkina <Marina.Vatkina_at_Sun.COM>
Date: Tue, 13 Nov 2007 12:15:54 -0800

Hi Farrukh,

You might have a better chance asking spec scoping question on the email for the
new JSR EG that is working on the JPA 2.0 spec.

Regards,
-marina

Farrukh Najmi wrote:
>
> But JDBC API supports setting transaction isolation on a JDBC Connection:
>
> <http://java.sun.com/j2se/1.5.0/docs/api/java/sql/Connection.html#setTransactionIsolation(int)>
>
>
> Why is there something analogous for JPA?
>
> James Sutherland wrote:
>
>> The transaction isolation is normally set as a default in the
>> database, or in
>> the DataSource or connection pool, not at runtime. This is probably
>> why the
>> JPA did not cover it as of yet.
>>
>> In TopLink Essentials you can set the default transaction isolation level
>> using a SessionCustomizer and calling the Session's DatabaseLogin's
>> setTransactionIsolation(int) API.
>>
>>
>> Farrukh Najmi-2 wrote:
>>
>>
>>> Farrukh Najmi wrote:
>>>
>>>
>>>> I was wondering what is the rationale for JPA to provide no
>>>> transaction isolation control in the API.
>>>> Specifically, what were the issues that prevented
>>>> EntityManager.getTransaction() to have a variant that
>>>> took a isolation level looking something like this:
>>>>
>>>> EntityTransaction
>>>> <http://java.sun.com/javaee/5/docs/api/javax/persistence/EntityTransaction.html>
>>>> *getTransaction*(int isolationLevel);
>>>>
>>>
>>> Oops. Above should read:
>>>
>>> EntityTransaction getTransaction(int isolationLevel);
>>>
>>>
>
>