Skip to content

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

Closed

Description

@spring-projects-issues

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:

Referenced from: commits 5ec2cd7

0 votes, 6 watchers

Activity

  1. spring-projects-issues commented on Jan 6, 2015

    @spring-projects-issues
    CollaboratorAuthor

    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

  2. spring-projects-issues commented on Jan 6, 2015

    @spring-projects-issues
    CollaboratorAuthor

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

  3. spring-projects-issues commented on Jan 6, 2015

    @spring-projects-issues
    CollaboratorAuthor

    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

  4. spring-projects-issues commented on Aug 26, 2015

    @spring-projects-issues
    CollaboratorAuthor

    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

  5. spring-projects-issues commented on Aug 27, 2015

    @spring-projects-issues
    CollaboratorAuthor

    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

  6. spring-projects-issues commented on Aug 27, 2015

    @spring-projects-issues
    CollaboratorAuthor

    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

Metadata

Metadata

Assignees

Labels

type: enhancement

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions