You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openjpa.apache.org by "Kevin Sutter (JIRA)" <ji...@apache.org> on 2012/07/24 22:09:33 UTC

[jira] [Commented] (OPENJPA-2235) "READ_UNCOMMITTED" setting for the fetch plan isolation level is ignored in DB2Dictionary

    [ https://issues.apache.org/jira/browse/OPENJPA-2235?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13421725#comment-13421725 ] 

Kevin Sutter commented on OPENJPA-2235:
---------------------------------------

Helen,
Thanks for taking a look at this jira and providing a patch.  Based on the initial problem description, we're only concerned with the openjpa.FetchPlan.Isolation hint getting set to UR, right?  But, your code patch would also work if the openjpa.jdbc.TransactionIsolation property is set.  At least that's what I get from this conditional:

         if ( isolationLevel == Connection.TRANSACTION_READ_UNCOMMITTED ) {

and isolation level is set via these statements earlier in this method:

        if (fetch != null && fetch.getIsolation() != -1)
            isolationLevel = fetch.getIsolation();
        else
            isolationLevel = conf.getTransactionIsolationConstant();

So, if we're looking to support UR for both the FetchPlan hint and the TransactionIsolation property, then your patch looks good.  But, if we're trying to fix just the FetchPlan hint, then the patch might be too broad.
                
> "READ_UNCOMMITTED" setting for the fetch plan isolation level is ignored in DB2Dictionary
> -----------------------------------------------------------------------------------------
>
>                 Key: OPENJPA-2235
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-2235
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: performance, query
>    Affects Versions: 2.1.1, 2.2.0, 2.3.0
>            Reporter: Helen Xu
>            Assignee: Helen Xu
>         Attachments: OPENJPA-2235.patch
>
>
> When user set query hint as shown below for db2, no "with UR" clause append to the query. The setting is ignored.
> query.setHint("openjpa.FetchPlan.Isolation", "READ_UNCOMMITTED");
> Uncommitted read is very risky and should be avoid if it is possible. JPA specification requires a minimum of read-committed isolation to ensure no "dirty read" and "non-repeatible read" can occur. Use of read-uncommitted isolation may cause data integrity problem.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira