HHH-11182 : minor correction to test required to backport

(cherry picked from commit 25fff43cc1)
This commit is contained in:
Gail Badner 2016-10-20 14:16:01 -07:00
parent 4f62ba9c81
commit 44bbc2ba8a
1 changed files with 3 additions and 2 deletions

View File

@ -23,6 +23,7 @@ import org.junit.Test;
import org.hibernate.Session;
import org.hibernate.resource.transaction.spi.TransactionStatus;
import org.hibernate.testing.TestForIssue;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
@ -49,7 +50,7 @@ public class JoinedSubclassSubQueryTest extends BaseCoreFunctionalTestCase {
s.getTransaction().commit();
}
catch (Exception e) {
if ( s.getTransaction() != null && s.getTransaction().isActive() ) {
if ( s.getTransaction() != null && s.getTransaction().getStatus() == TransactionStatus.ACTIVE ) {
s.getTransaction().rollback();
}
throw e;
@ -75,7 +76,7 @@ public class JoinedSubclassSubQueryTest extends BaseCoreFunctionalTestCase {
s.createQuery( queryHQL ).uniqueResult();
}
catch (Exception e) {
if ( s.getTransaction() != null && s.getTransaction().isActive() ) {
if ( s.getTransaction() != null && s.getTransaction().getStatus() == TransactionStatus.ACTIVE ) {
s.getTransaction().rollback();
}
throw e;