HHH-17442 Use FlushMode.MANUAL for select query in ValidityAuditStrategy
This commit is contained in:
parent
2c86dcd5be
commit
a3342ec233
|
@ -15,6 +15,7 @@ import java.util.List;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
import org.hibernate.FlushMode;
|
||||||
import org.hibernate.LockOptions;
|
import org.hibernate.LockOptions;
|
||||||
import org.hibernate.Session;
|
import org.hibernate.Session;
|
||||||
import org.hibernate.engine.jdbc.spi.JdbcCoordinator;
|
import org.hibernate.engine.jdbc.spi.JdbcCoordinator;
|
||||||
|
@ -258,7 +259,7 @@ public class ValidityAuditStrategy implements AuditStrategy {
|
||||||
|
|
||||||
addEndRevisionNullRestriction( configuration, qb.getRootParameters() );
|
addEndRevisionNullRestriction( configuration, qb.getRootParameters() );
|
||||||
|
|
||||||
final List<Object> l = qb.toQuery( session ).setLockOptions( LockOptions.UPGRADE ).list();
|
final List<Object> l = qb.toQuery( session ).setHibernateFlushMode(FlushMode.MANUAL).setLockOptions( LockOptions.UPGRADE ).list();
|
||||||
|
|
||||||
// Update the last revision if one exists.
|
// Update the last revision if one exists.
|
||||||
// HHH-5967: with collections, the same element can be added and removed multiple times. So even if it's an
|
// HHH-5967: with collections, the same element can be added and removed multiple times. So even if it's an
|
||||||
|
|
Loading…
Reference in New Issue