Felix König (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=5a4bad5...
) *created* an issue
Hibernate ORM (
https://hibernate.atlassian.net/browse/HHH?atlOrigin=eyJpIjoiNzQ4MDAzYTFl...
) / Bug (
https://hibernate.atlassian.net/browse/HHH-16249?atlOrigin=eyJpIjoiNzQ4MD...
) HHH-16249 (
https://hibernate.atlassian.net/browse/HHH-16249?atlOrigin=eyJpIjoiNzQ4MD...
) StatelessSession does not flush when using jdbc batch_size > 1 (
https://hibernate.atlassian.net/browse/HHH-16249?atlOrigin=eyJpIjoiNzQ4MD...
)
Issue Type: Bug Affects Versions: 6.1.7 Assignee: Unassigned Attachments:
hibernate-stateless-session-flush-bug-repro-HHH-4042.zip Components: hibernate-core
Created: 03/Mar/2023 04:34 AM Priority: Major Reporter: Felix König (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=5a4bad5...
)
This is a duplicate of
https://hibernate.atlassian.net/browse/HHH-4042 (
https://hibernate.atlassian.net/browse/HHH-4042 ) , but that one was closed and I was
asked to create a new issue, so here it is 🙂
I have attached a reproducer. Here’s also a minimal snippet to reproduce the issue:
session.doWork(connection -> {
try (StatelessSession statelessSession =
session.getSessionFactory().openStatelessSession(connection)) {
statelessSession.setJdbcBatchSize(2);
statelessSession.insert( new TestEntity(1));
statelessSession.insert( new TestEntity(2));
statelessSession.insert( new TestEntity(3));
}
});
session.flush();
List<TestEntity> entities = session.createQuery( "select t from TestEntity
t" , TestEntity.class).getResultList();
Assert.assertEquals( "All 3 entities were persisted" , 3, entities.size());
(
https://hibernate.atlassian.net/browse/HHH-16249#add-comment?atlOrigin=ey...
) Add Comment (
https://hibernate.atlassian.net/browse/HHH-16249#add-comment?atlOrigin=ey...
)
Get Jira notifications on your phone! Download the Jira Cloud app for Android (
https://play.google.com/store/apps/details?id=com.atlassian.android.jira....
) or iOS (
https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=Em...
) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100217- sha1:65be9f2 )