native query bulk operation otuside transaction should unlock cache region

This commit is contained in:
Andrea Boriero 2024-08-23 13:50:49 +02:00
parent e30e4163c3
commit de379ffd21
1 changed files with 2 additions and 2 deletions

View File

@ -163,7 +163,7 @@ public class BulkOperationCleanupAction implements Executable, Serializable {
public static void schedule(SharedSessionContractImplementor session, EntityPersister... affectedQueryables) {
final BulkOperationCleanupAction action = new BulkOperationCleanupAction( session, affectedQueryables );
if ( session.isEventSource() ) {
if ( session.isEventSource() && session.isTransactionInProgress() ) {
session.asEventSource().getActionQueue().addAction( action );
}
else {
@ -173,7 +173,7 @@ public class BulkOperationCleanupAction implements Executable, Serializable {
public static void schedule(SharedSessionContractImplementor session, Set<String> affectedQueryables) {
final BulkOperationCleanupAction action = new BulkOperationCleanupAction( session, affectedQueryables );
if ( session.isEventSource() ) {
if ( session.isEventSource() && session.isTransactionInProgress() ) {
session.asEventSource().getActionQueue().addAction( action );
}
else {