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:
parent
5cc6eed50a
commit
eec7b8ab11
|
@ -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() ) {
|
||||||
|
|
|
@ -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();
|
||||||
|
|
Loading…
Reference in New Issue