HHH-12830 Improve error message when a method is called in a non active
transaction
This commit is contained in:
parent
cc600abf38
commit
c17a83cc0d
|
@ -342,7 +342,8 @@ public class ThreadLocalSessionContext extends AbstractCurrentSessionContext {
|
||||||
LOG.tracef( "Allowing invocation [%s] to proceed to real (non-transacted) session - deprecated methods", methodName );
|
LOG.tracef( "Allowing invocation [%s] to proceed to real (non-transacted) session - deprecated methods", methodName );
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
throw new HibernateException( methodName + " is not valid without active transaction" );
|
throw new HibernateException( "Calling method '" + methodName + "' is not valid without an active transaction (Current status: "
|
||||||
|
+ realSession.getTransaction().getStatus() + ")" );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
LOG.tracef( "Allowing proxy invocation [%s] to proceed to real session", methodName );
|
LOG.tracef( "Allowing proxy invocation [%s] to proceed to real session", methodName );
|
||||||
|
|
Loading…
Reference in New Issue