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;
try {
// A call to begin() with an active Tx should cause an IllegalStateException
tx = s.beginTransaction();
tx = s.getTransaction();
tx.begin();
}
catch (Exception e) {
if ( tx != null && tx.isActive() ) {

View File

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