Skip to content

Commit 4376d37

Browse files
committed
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
1 parent ecb655f commit 4376d37

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

hibernate-core/src/test/java/org/hibernate/orm/test/resource/transaction/jta/JpaComplianceAlreadyStartedTransactionTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ public void anIllegalStateExceptionShouldBeThrownWhenBeginTxIsCalledWithAnAlread
4545
Transaction tx = null;
4646
try {
4747
// A call to begin() with an active Tx should cause an IllegalStateException
48-
tx = s.beginTransaction();
48+
tx = s.getTransaction();
49+
tx.begin();
4950
}
5051
catch (Exception e) {
5152
if ( tx != null && tx.isActive() ) {

hibernate-core/src/test/java/org/hibernate/orm/test/resource/transaction/jta/NonJpaComplianceAlreadyStartedTransactionTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ public void setUp() {
5050
public void noIllegalStateExceptionShouldBeThrownWhenBeginTxIsCalledWithAnAlreadyActiveTx() throws Exception {
5151
tm.begin();
5252
try (Session s = openSession()) {
53-
Transaction tx = s.beginTransaction();
53+
Transaction tx = s.getTransaction();
54+
tx.begin();
5455
try {
5556
s.persist( new TestEntity( "ABC" ) );
5657
tx.commit();

0 commit comments

Comments
 (0)