mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
Fix for #70 - @PrivateOwned makes Ebean try to remove non persistent objects from DB and throws OptimisticLockException
This commit is contained in:
@@ -29,12 +29,14 @@ public class TestPrivateOwnedIgnoreTransientOrphan extends BaseTestCase {
|
||||
|
||||
master1 = Ebean.find(master0.getClass(), master0.getId());
|
||||
|
||||
// Add then remove a bean that was never saved (to the DB)
|
||||
master1.getDetails().add(new TSDetail());
|
||||
master1.getDetails().clear();
|
||||
|
||||
try{
|
||||
Ebean.save(master1);
|
||||
} catch (OptimisticLockException exception) {
|
||||
// Occured when the "unsaved" bean was wrongly being deleted
|
||||
Assert.fail("Optimistic lock exception wrongly thrown: " + exception.getMessage());
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user