Bug 160 : Assoc OneToOne with Cascade on both sides - Delete gives OptimisticLockException
Priority 
High
Reported Version 
 
Logged By 
Rob
Status 
Fixed
Fixed Version 
2.2.0
Assigned To 
 
Product 
Ebean - core
Duplicate Of 
 
Created 
28/09/2009
Updated 
28/09/2009
Type 
Bug
 
Attachments 
No attachments

TestCase from Eddie.

TestSaveDelete:

// This fails
public void testCreateDeletePersistentFile() {
PersistentFile persistentFile = new PersistentFile("test.txt",
new PersistentFileContent("test".getBytes()));

Ebean.save(persistentFile);
Ebean.delete(persistentFile);
}

 
Rob 28 Sep 10:17
Transaction logs...

Transaction logs show the delete of PersistentFileContent occurs twice. It should occur once and then delete the PersistentFile entity.

Rob 28 Sep 11:30
Fixed in HEAD

Fixed in HEAD.

To support Cascade delete on both sides we register a hash of the bean type and id.

woResponse

Upload a file