1. OpenJPA
  2. OPENJPA-1943

Query timeout hint not honored consistently when pessimistic lock is issued to database requires multi-statements locking scheme


    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.1, 2.1.0, 2.2.0
    • Fix Version/s: 2.1.1, 2.2.0
    • Component/s: jpa, kernel
    • Labels:
    • Patch Info:
      Patch Available


      Query timeout and lock timeout values are stored in fetch plan/configuration. Due to semantic difference between the Query and em API, separate fetch plan/configuration objects are attached to QueryImpl and EntityManagerImpl.

      When pessimistic lock is enforced by the provider to a query, if the underlying data base requires to generate multiple SQL statements, the timeout value from the QueryImpl is used to execute the data portion of the SQL statements but the timeout value from the EntityManagerImpl is used to issue the "FOR UPDATE" lock to the related table. This caused the discrepancy that the query timeout is NOT being honored. As a result, some database may wait forever and caused a "hung" scenario even the query timeout value is set.


        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open In Progress In Progress
        20h 3m 1 Albert Lee 18/Feb/11 17:04
        In Progress In Progress Resolved Resolved
        2h 34m 1 Albert Lee 18/Feb/11 19:38
        Resolved Resolved Closed Closed
        7s 1 Albert Lee 18/Feb/11 19:38
        Albert Lee made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Albert Lee made changes -
        Status In Progress [ 3 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Albert Lee made changes -
        Status Open [ 1 ] In Progress [ 3 ]
        Albert Lee made changes -
        Patch Info [Patch Available]
        Albert Lee made changes -
        Field Original Value New Value
        Attachment OPENJPA-1943.patch [ 12471421 ]
        Albert Lee created issue -


          • Assignee:
            Albert Lee
            Albert Lee
          • Votes:
            0 Vote for this issue
            0 Start watching this issue


            • Created: