Refined DefaultJpaDialect's InvalidIsolationLevelException message
Issue: SPR-8325
This commit is contained in:
parent
0d710f197e
commit
af13310da0
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2002-2013 the original author or authors.
|
* Copyright 2002-2014 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.
|
||||||
|
|
@ -31,8 +31,8 @@ import org.springframework.transaction.TransactionException;
|
||||||
* Default implementation of the {@link JpaDialect} interface.
|
* Default implementation of the {@link JpaDialect} interface.
|
||||||
* Used as default dialect by {@link JpaTransactionManager}.
|
* Used as default dialect by {@link JpaTransactionManager}.
|
||||||
*
|
*
|
||||||
* <p>Simply begins a standard JPA transaction in {@link #beginTransaction}
|
* <p>Simply begins a standard JPA transaction in {@link #beginTransaction} and
|
||||||
* and performs standard exception translation through {@link EntityManagerFactoryUtils}.
|
* performs standard exception translation through {@link EntityManagerFactoryUtils}.
|
||||||
*
|
*
|
||||||
* <p><b>NOTE: Spring's JPA support requires JPA 2.0 or higher, as of Spring 4.0.</b>
|
* <p><b>NOTE: Spring's JPA support requires JPA 2.0 or higher, as of Spring 4.0.</b>
|
||||||
*
|
*
|
||||||
|
|
@ -60,9 +60,9 @@ public class DefaultJpaDialect implements JpaDialect, Serializable {
|
||||||
throws PersistenceException, SQLException, TransactionException {
|
throws PersistenceException, SQLException, TransactionException {
|
||||||
|
|
||||||
if (definition.getIsolationLevel() != TransactionDefinition.ISOLATION_DEFAULT) {
|
if (definition.getIsolationLevel() != TransactionDefinition.ISOLATION_DEFAULT) {
|
||||||
throw new InvalidIsolationLevelException(
|
throw new InvalidIsolationLevelException(getClass().getSimpleName() +
|
||||||
"Standard JPA does not support custom isolation levels - " +
|
" does not support custom isolation levels due to limitations in standard JPA. " +
|
||||||
"use a special JpaDialect for your JPA implementation");
|
"Specific arrangements may be implemented in custom JpaDialect variants.");
|
||||||
}
|
}
|
||||||
entityManager.getTransaction().begin();
|
entityManager.getTransaction().begin();
|
||||||
return null;
|
return null;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue