Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Log warning for Isolation.READ_UNCOMMITTED with Propagation.NOT_SUPPORTED [SPR-12600] #17201

Closed
spring-issuemaster opened this issue Jan 6, 2015 · 6 comments

Comments

Projects
None yet
2 participants
@spring-issuemaster
Copy link
Collaborator

commented Jan 6, 2015

Ethan Zhang opened SPR-12600 and commented

The actual Isolation Level for the setting
"@Transactional(propagation = Propagation.NOT_SUPPORTED, isolation = Isolation.READ_UNCOMMITTED)"
is READ_COMMITTED rather than READ_UNCOMMITTED.

The environment:
spring: 3.1.0
hibernate: 3.5.6


Affects: 3.1 GA

Issue Links:

  • #19583 Validation of existing transactions with transaction synchronization turned off not working (?)
  • #11234 Rollback of transaction participating in nested transaction should not enforce rollback of global transaction

Referenced from: commits 5ec2cd7

0 votes, 6 watchers

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

commented 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-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

commented 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-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

commented 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-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

commented 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-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

commented 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-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

commented 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.