Skip to content

Commit d10220e

Browse files
committed
Refined DefaultJpaDialect's InvalidIsolationLevelException message
Issue: SPR-8325 (cherry picked from commit af13310)
1 parent fe72fce commit d10220e

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

spring-orm/src/main/java/org/springframework/orm/jpa/DefaultJpaDialect.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2012 the original author or authors.
2+
* Copyright 2002-2014 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -18,7 +18,6 @@
1818

1919
import java.io.Serializable;
2020
import java.sql.SQLException;
21-
2221
import javax.persistence.EntityManager;
2322
import javax.persistence.EntityManagerFactory;
2423
import javax.persistence.PersistenceException;
@@ -64,9 +63,9 @@ public Object beginTransaction(EntityManager entityManager, TransactionDefinitio
6463
throws PersistenceException, SQLException, TransactionException {
6564

6665
if (definition.getIsolationLevel() != TransactionDefinition.ISOLATION_DEFAULT) {
67-
throw new InvalidIsolationLevelException(
68-
"Standard JPA does not support custom isolation levels - " +
69-
"use a special JpaDialect for your JPA implementation");
66+
throw new InvalidIsolationLevelException(getClass().getSimpleName() +
67+
" does not support custom isolation levels due to limitations in standard JPA. " +
68+
"Specific arrangements may be implemented in custom JpaDialect variants.");
7069
}
7170
entityManager.getTransaction().begin();
7271
return null;

0 commit comments

Comments
 (0)