Hey there,
For [the last round of statements to not get flushed] to happen, the inserts need to be inside in a transaction opened by the stateless session
I am not sure why this is a requirement. In fact, using the stateless session the “conventional way”, meaning purely within a transaction managed by the stateless session, works fine for all jdbc batch sizes:
statelessSession.getTransaction().begin();
statelessSession.getTransaction().commit();
But in the example I provided, the batch size is 2, and the third entity is lost (the test fails). |