mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
Add test for transaction Propagation.REQUIRES_NEW
This commit is contained in:
@@ -62,10 +62,14 @@ public class EbeanSpringModuleTest {
|
||||
|
||||
@Test
|
||||
public void testBatchInsert() {
|
||||
|
||||
userService.batchInsert();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testRequiresNew() {
|
||||
userService.requiresNew();
|
||||
}
|
||||
|
||||
/**
|
||||
* Test app.
|
||||
*/
|
||||
|
||||
@@ -14,4 +14,6 @@ public interface UserService {
|
||||
void nonTransactional();
|
||||
|
||||
void batchInsert();
|
||||
|
||||
void requiresNew();
|
||||
}
|
||||
|
||||
@@ -59,6 +59,13 @@ public class UserServiceImpl implements UserService {
|
||||
System.out.println("---------after batch-------");
|
||||
}
|
||||
|
||||
@Transactional(propagation = Propagation.REQUIRES_NEW)
|
||||
public void requiresNew() {
|
||||
User user = new User();
|
||||
user.setName("user_x0");
|
||||
ebeanServer.save(user);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return the ebean server.
|
||||
|
||||
Reference in New Issue
Block a user