fix tests which were asserting stuff about JPA compliance for a non-JPA method

The JPA spec does not have anything to say about our beginTransaction() method
This commit is contained in:
Gavin King 2024-11-20 23:26:00 +01:00
parent 5cc6eed50a
commit eec7b8ab11
2 changed files with 4 additions and 2 deletions

View File

@ -45,7 +45,8 @@ public class JpaComplianceAlreadyStartedTransactionTest extends BaseNonConfigCor
Transaction tx = null; Transaction tx = null;
try { try {
// A call to begin() with an active Tx should cause an IllegalStateException // A call to begin() with an active Tx should cause an IllegalStateException
tx = s.beginTransaction(); tx = s.getTransaction();
tx.begin();
} }
catch (Exception e) { catch (Exception e) {
if ( tx != null && tx.isActive() ) { if ( tx != null && tx.isActive() ) {

View File

@ -50,7 +50,8 @@ public class NonJpaComplianceAlreadyStartedTransactionTest extends BaseNonConfig
public void noIllegalStateExceptionShouldBeThrownWhenBeginTxIsCalledWithAnAlreadyActiveTx() throws Exception { public void noIllegalStateExceptionShouldBeThrownWhenBeginTxIsCalledWithAnAlreadyActiveTx() throws Exception {
tm.begin(); tm.begin();
try (Session s = openSession()) { try (Session s = openSession()) {
Transaction tx = s.beginTransaction(); Transaction tx = s.getTransaction();
tx.begin();
try { try {
s.persist( new TestEntity( "ABC" ) ); s.persist( new TestEntity( "ABC" ) );
tx.commit(); tx.commit();