You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@metamodel.apache.org by jakubneubauer <gi...@git.apache.org> on 2018/10/04 07:57:37 UTC

[GitHub] metamodel issue #190: Added cache for prepared statements in JdbcUpdateCallb...

Github user jakubneubauer commented on the issue:

    https://github.com/apache/metamodel/pull/190
  
    Today I discovered one issue with this MR, which means backward incompatibility. When using batching, it means JdbcBatchUpdateCallback, this bigger cache is not safe. Resp. the order of executed statements can be changed. Because the commands are buffered (via Statement.addBatch) and they are then flushed for each prepared statement together.
    So for example, when user runs commands in this order: A, B, A, B, they are actually executed in order A, A, B, B. Moreover, it can be also B, B, A, A, because order of closing and flushing prepared statements from the cache is undefined.
    So the bigger cache is safe to use only for non-batching JdbcSimpleUpdateCallback.


---