mirror of
https://github.com/hibernate/hibernate-orm
synced 2025-03-04 08:49:22 +00:00
HHH-11127 - Confused batch processing doc example
This commit is contained in:
parent
4dbef2fdf0
commit
814ea97b85
@ -206,7 +206,7 @@ private void withBatch() {
|
||||
Person Person = new Person( String.format( "Person %d", i ) );
|
||||
entityManager.persist( Person );
|
||||
|
||||
if ( i % batchSize == 0 ) {
|
||||
if ( i > 0 && i % batchSize == 0 ) {
|
||||
//flush a batch of inserts and release memory
|
||||
entityManager.flush();
|
||||
entityManager.clear();
|
||||
|
Loading…
x
Reference in New Issue
Block a user