• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

what isolation level should be used for basic CRUD operation in spring JTA Transaction.

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
what isolation level should be used for basic CRUD operation in Spring JTA Transaction.

I have one java project and 2 Web Applications which are bundled in EAR.
In java project i have service classes and DAO classes which are shared between web application using Spring configured using context param parentContextKey .
And web application specific DAO 's are in web application project.
DAO 's does basic CRUD operations.
I my using @persistenceContext which injected is injected in DAO using Spring.

so my question is which isolation level should i use when i annotated the method with @Transaction.By default ISOLATION_SERIALIZABLE is used.
what is isolation_default level will do.

Please help to understand when to use ISOLATION_SERIALIZABLE and ISOLATION_DEFAULT.Considering the above scenario please help me to choose isolation level if any thing else i need to use.
And also we are going to create Clusters for the EAR in Websphere Application Server.Does isolation level have any impact on the Clusters.
Please help me.
Thanks in Advance.
 
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"when i annotated the method with @Transaction.By default ISOLATION_SERIALIZABLE"

Um, the default setting in @Transactional is Isolation.DEFAULT. Which means it takes the databases default. Each database has its own default setting for isolation level, and Spring will use that.

I know of no database that has a default of Serializable. That is extreme and the slowest. You use that only for life or death use cases. Typically the database will use READ_COMMITTED or REPEATABLE_READS.

If you know the use case is only going to query, then set readOnly="true"

Typically, when using @Transactional you never do any setting inside the annotation because the defaults cover at least 90% of the use cases.

Mark
reply
    Bookmark Topic Watch Topic
  • New Topic