Browse Source

AbstractPlatformTransactionManager logs warning for custom isolation level in case of no actual transaction

Issue: SPR-12600
pull/753/head
Juergen Hoeller 11 years ago
parent
commit
5ec2cd7947
  1. 6
      spring-tx/src/main/java/org/springframework/transaction/support/AbstractPlatformTransactionManager.java

6
spring-tx/src/main/java/org/springframework/transaction/support/AbstractPlatformTransactionManager.java

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2014 the original author or authors. * Copyright 2002-2015 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -385,6 +385,10 @@ public abstract class AbstractPlatformTransactionManager implements PlatformTran
} }
else { else {
// Create "empty" transaction: no actual transaction, but potentially synchronization. // Create "empty" transaction: no actual transaction, but potentially synchronization.
if (definition.getIsolationLevel() != TransactionDefinition.ISOLATION_DEFAULT && logger.isWarnEnabled()) {
logger.warn("Custom isolation level specified but no actual transaction initiated; " +
"isolation level will effectively be ignored: " + definition);
}
boolean newSynchronization = (getTransactionSynchronization() == SYNCHRONIZATION_ALWAYS); boolean newSynchronization = (getTransactionSynchronization() == SYNCHRONIZATION_ALWAYS);
return prepareTransactionStatus(definition, null, true, newSynchronization, debugEnabled, null); return prepareTransactionStatus(definition, null, true, newSynchronization, debugEnabled, null);
} }

Loading…
Cancel
Save