HHH-11209 : Log a DEBUG message if collection with queued operations is detached due to rollback; otherwise, log INFO message
(cherry picked from commit e12a688524
)
This commit is contained in:
parent
ed1644247e
commit
638a181461
|
@ -612,6 +612,7 @@ public abstract class AbstractPersistentCollection implements Serializable, Pers
|
|||
if ( !isTempSession ) {
|
||||
if ( hasQueuedOperations() ) {
|
||||
final String collectionInfoString = MessageHelper.collectionInfoString( getRole(), getKey() );
|
||||
try {
|
||||
final TransactionStatus transactionStatus =
|
||||
session.getTransactionCoordinator().getTransactionDriverControl().getStatus();
|
||||
if ( transactionStatus.isOneOf(
|
||||
|
@ -621,9 +622,18 @@ public abstract class AbstractPersistentCollection implements Serializable, Pers
|
|||
TransactionStatus.FAILED_ROLLBACK,
|
||||
TransactionStatus.ROLLING_BACK
|
||||
) ) {
|
||||
// It was due to a rollback.
|
||||
LOG.queuedOperationWhenDetachFromSessionOnRollback( collectionInfoString );
|
||||
}
|
||||
else {
|
||||
// We don't know why the collection is being detached.
|
||||
// Just log the info.
|
||||
LOG.queuedOperationWhenDetachFromSession( collectionInfoString );
|
||||
}
|
||||
}
|
||||
catch (Exception e) {
|
||||
// We don't know why the collection is being detached.
|
||||
// Just log the info.
|
||||
LOG.queuedOperationWhenDetachFromSession( collectionInfoString );
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1800,7 +1800,7 @@ public interface CoreMessageLogger extends BasicLogger {
|
|||
@Message(value = "Attaching an uninitialized collection with queued operations to a session: %s", id = 495)
|
||||
void queuedOperationWhenAttachToSession(String collectionInfoString);
|
||||
|
||||
@LogMessage(level = WARN)
|
||||
@LogMessage(level = INFO)
|
||||
@Message(value = "Detaching an uninitialized collection with queued operations from a session: %s", id = 496)
|
||||
void queuedOperationWhenDetachFromSession(String collectionInfoString);
|
||||
|
||||
|
|
Loading…
Reference in New Issue