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.
"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.