#467 - Delete bean with unloaded version property throws OptimisticLockException

This commit is contained in:
Robin Bygrave
2015-11-26 15:12:59 +13:00
parent 872f0e21cb
commit a2ee0bfdbe
2 changed files with 21 additions and 1 deletions
@@ -0,0 +1,20 @@
package com.avaje.tests.delete;
import com.avaje.ebean.BaseTestCase;
import com.avaje.ebean.Ebean;
import com.avaje.tests.model.basic.Contact;
import org.junit.Test;
public class TestDeleteWithoutOptimisticLocking extends BaseTestCase {
@Test
public void test() {
// delete by by without version loaded ... should not throw OptimisticLockException
Contact ref = Ebean.getReference(Contact.class, 999999);
Ebean.delete(ref);
Ebean.delete(Contact.class, 999999);
}
}