mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
Add test for beginTransaction() with existing active transaction
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
package com.avaje.tests.transaction;
|
||||
|
||||
import com.avaje.ebean.BaseTestCase;
|
||||
import com.avaje.ebean.Ebean;
|
||||
import com.avaje.ebean.Transaction;
|
||||
import org.junit.Test;
|
||||
|
||||
import javax.persistence.PersistenceException;
|
||||
|
||||
public class TestBeginTransactionWithExisting extends BaseTestCase {
|
||||
|
||||
@Test(expected = PersistenceException.class)
|
||||
public void test() {
|
||||
|
||||
Transaction txn = Ebean.beginTransaction();
|
||||
try {
|
||||
|
||||
Ebean.beginTransaction();
|
||||
|
||||
} finally {
|
||||
txn.end();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user