HHH-8442 certain EntityManager operations (createQuery()) should rollback the TX for when Runtime exceptions are thrown
This commit is contained in:
parent
4027f131e3
commit
bcb84dd49b
|
@ -730,8 +730,13 @@ public abstract class AbstractEntityManagerImpl implements HibernateEntityManage
|
||||||
@Override
|
@Override
|
||||||
public <T> TypedQuery<T> createQuery(CriteriaQuery<T> criteriaQuery) {
|
public <T> TypedQuery<T> createQuery(CriteriaQuery<T> criteriaQuery) {
|
||||||
checkOpen();
|
checkOpen();
|
||||||
|
try {
|
||||||
return (TypedQuery<T>) criteriaCompiler().compile( (CompilableCriteria) criteriaQuery );
|
return (TypedQuery<T>) criteriaCompiler().compile( (CompilableCriteria) criteriaQuery );
|
||||||
}
|
}
|
||||||
|
catch ( RuntimeException e ) {
|
||||||
|
throw convert( e );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Query createQuery(CriteriaUpdate criteriaUpdate) {
|
public Query createQuery(CriteriaUpdate criteriaUpdate) {
|
||||||
|
@ -1280,6 +1285,7 @@ public abstract class AbstractEntityManagerImpl implements HibernateEntityManage
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CriteriaBuilder getCriteriaBuilder() {
|
public CriteriaBuilder getCriteriaBuilder() {
|
||||||
|
|
||||||
checkOpen();
|
checkOpen();
|
||||||
return getEntityManagerFactory().getCriteriaBuilder();
|
return getEntityManagerFactory().getCriteriaBuilder();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue