1. OpenJPA
  2. OPENJPA-530

Statement batching incorrectly re-arranged order of SQL statements organized by update managers


    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.1.0
    • Fix Version/s: 1.1.0
    • Component/s: jdbc
    • Labels:


      BatchingPreparedStatementManagerImpl implements the core SQL statement execution function of the Statement Batching features.

      The current implementation of this class holds a cache that maps SQL prepared statements to a collection of parameters of batched requests for that prepared statement. When update manager finishes batching its requests, BatchingPreparedStatementManagerImpl.flush() method is called to submit the batch elements in the cache to the jdbc driver.

      Essentially, this implementation discards all the ordering of statements being dispatched to the statement batching function by the update manager. This caused improper order of SQL statements to be sent to the data store. As a result, the underlying database may throw exception indicates the unexpected data condition. E.g. Error for batch element #2: DB2 SQL error: SQLCODE: -530, SQLSTATE: 23503, SQLERRMC: LEEALBER.EMPBEAN.SQL080226132752530
      SQL0530N: The insert or update value of the FOREIGN KEY constraint-name is not equal to any value of the parent key of the parent table.


        Albert Lee made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Albert Lee made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Albert Lee made changes -
        Field Original Value New Value
        Attachment OPENJPA-530.patch [ 12376948 ]
        Albert Lee created issue -


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


            • Created: