You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Log warning for Isolation.READ_UNCOMMITTED with Propagation.NOT_SUPPORTED [SPR-12600] #17201
The actual Isolation Level for the setting
"@Transactional(propagation = Propagation.NOT_SUPPORTED, isolation = Isolation.READ_UNCOMMITTED)"
is READ_COMMITTED rather than READ_UNCOMMITTED.
Note that isolation levels are just supported within actual transactions, i.e. propagation REQUIRED or REQUIRES_NEW, initiating a resource transaction.
Your configuration essentially suggests non-transactional execution, which - in the JDBC case - a JDBC driver doesn't support an isolation level for (since an underlying RDBMS doesn't support isolation levels in auto-commit mode).
Indeed, you would also get the warning with that configuration, since your isolation level will always get ignored in that case as well. It's always the outermost transaction boundary initiating the isolation level, so a SUPPORTS boundary will never actually initiate it... Therefore you can simply omit the isolation level in such a case.
That right, this is my errors in reasoning. With SUPPORTS you can use exisiting transaction and with exisiting transaction you use the isolation level of the existing transaction.
Activity
spring-projects-issues commentedon Jan 6, 2015
Juergen Hoeller commented
Note that isolation levels are just supported within actual transactions, i.e. propagation REQUIRED or REQUIRES_NEW, initiating a resource transaction.
Your configuration essentially suggests non-transactional execution, which - in the JDBC case - a JDBC driver doesn't support an isolation level for (since an underlying RDBMS doesn't support isolation levels in auto-commit mode).
Juergen
spring-projects-issues commentedon Jan 6, 2015
Ethan Zhang commented
Thanks a lot.
I see, isolation levels are just supported within actual transactions!
And I think it will be better if Spring can warn such configuration (configured a isolation level for Propagation.NOT_SUPPORTED).
spring-projects-issues commentedon Jan 6, 2015
Juergen Hoeller commented
Good point, we could log a warning for such a scenario, assuming that the combination of settings never really makes sense...
Juergen
spring-projects-issues commentedon Aug 26, 2015
Hanh Pham commented
Hi Jurgen,
if you have this transactional configuration, you would also get the warning, although you do not need a transaction. Is this correct?
@Transactional(propagation = Propagation.SUPPORTS, isolation = Isolation.REPEATABLE_READ, readOnly = true)The commit:
5ec2cd7
Hanh
spring-projects-issues commentedon Aug 27, 2015
Juergen Hoeller commented
Indeed, you would also get the warning with that configuration, since your isolation level will always get ignored in that case as well. It's always the outermost transaction boundary initiating the isolation level, so a SUPPORTS boundary will never actually initiate it... Therefore you can simply omit the isolation level in such a case.
Juergen
spring-projects-issues commentedon Aug 27, 2015
Hanh Pham commented
That right, this is my errors in reasoning. With SUPPORTS you can use exisiting transaction and with exisiting transaction you use the isolation level of the existing transaction.
Thanks for your answer.
Hanh