openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Albert Lee (JIRA)" <j...@apache.org>
Subject [jira] Created: (OPENJPA-1394) Pessimistic Lock not honour when ORDER BY clause is used
Date Wed, 18 Nov 2009 15:38:39 GMT
Pessimistic Lock not honour when ORDER BY clause is used
--------------------------------------------------------

                 Key: OPENJPA-1394
                 URL: https://issues.apache.org/jira/browse/OPENJPA-1394
             Project: OpenJPA
          Issue Type: Bug
          Components: query
    Affects Versions: 2.0.0-M3, 2.0.0
            Reporter: Albert Lee
            Assignee: Albert Lee



  query = em.createQuery(
    "select e.department from Employee e where e.id < 10 order by e.department.id").setFirstResult(3);
  query.setLockMode(LockModeType.PESSIMISTIC_READ);
  q = query.getResultList();

yields the following SQL statement but with no lock on the Employee row:

openjpa.Runtime: Info: The database is unable to lock this query.  Each object matching the
query will be locked individually after it is loaded; however, it is technically possible
that another transaction could modify the data before the lock is obtained.  See the documentation
on Object Locking for details.
"SELECT t1.ID, t1.NAME, t0.FK_DEPT FROM CTS1.EMPLOYEE t0 LEFT OUTER JOIN CTS1.DEPARTMENT t1
ON t0.FK_DEPT = t1.ID WHERE (t0.ID < CAST(? AS BIGINT)) ORDER BY t0.FK_DEPT ASC " 
openjpa.jdbc.SQL: Trace: <t 2035185998, conn 1784113751> executing prepstmnt 1845128698
SELECT t1.ID, t1.NAME, t0.FK_DEPT FROM CTS1.EMPLOYEE t0 LEFT OUTER JOIN CTS1.DEPARTMENT t1
ON t0.FK_DEPT = t1.ID WHERE (t0.ID < CAST(? AS BIGINT)) ORDER BY t0.FK_DEPT ASC  [params=(long)
10]

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message