mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
Remove deprecated database.commitTransaction(), migrate to transaction.commit()
Remove the deprecated methods: - DB.commitTransaction() - DB.rollbackTransaction() - DB.endTransaction() - database.commitTransaction() - database.rollbackTransaction() - database.endTransaction() Migrate to using try-with-resources and transaction.commit(), transaction.rollback()
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package org.tests.basic;
|
||||
|
||||
import io.ebean.Transaction;
|
||||
import io.ebean.xtest.BaseTestCase;
|
||||
import io.ebean.DB;
|
||||
import org.junit.jupiter.api.Test;
|
||||
@@ -17,8 +18,7 @@ public class TestInheritRef extends BaseTestCase {
|
||||
@Test
|
||||
public void testAssocOne() {
|
||||
|
||||
DB.beginTransaction();
|
||||
try {
|
||||
try (Transaction txn = DB.beginTransaction()) {
|
||||
DB.createUpdate(Vehicle.class, "delete from vehicle");
|
||||
|
||||
Car c = new Car();
|
||||
@@ -52,9 +52,6 @@ public class TestInheritRef extends BaseTestCase {
|
||||
|
||||
assertEquals(1, found);
|
||||
assertTrue(foundTruck.getCapacity() == 20D);
|
||||
|
||||
} finally {
|
||||
DB.rollbackTransaction();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user