Update statement does not get generated when flushing in case we have batching on for following example:
After some debugging found quick workaround and potentially source of the problem, removing
from org.hibernate.engine.jdbc.internal.JdbcCoordinatorImpl.getBatch solves the problem. It seems that state of currentBatch is left from previous statement execution but with all preparestatements cleared. And since BatchKey is the same as previous update empty batch, without prepared statements, is being reused and no update statement is being generated/executed. This issue seems to be related to https://hibernate.atlassian.net/browse/HHH-16367 but that one is I think wrongfully closed as duplicate. |