Joined: Mon Mar 13, 2006 3:02 pm Posts: 3
|
----------------- ----------------
| Component | |Block |
----------------- 1 0..1 ----------------
| id | <----------------> | id |
----------------- ----------------
| attributes | | attributes |
----------------- ----------------
Component
<one-to-one name="block" class="com.actenum.allora.vo.Block" cascade="save-update,delete" />
Block
<one-to-one name="component" class="com.actenum.allora.vo.Component" />
Component aComponent = new Component() //Brand new component Component represents a tree of components
//Set some blocks for some children Works OK
for (Component vo:children){
Block block = new Block();
block.setComponent(vo);
vo.setBlock(block);
}
// Save the component. Works OK with the note that the Block is saved first and the aComponent children references to the block are not nullified
service.save(aComponent);
for (Component vo:children){
service.delete(vo.getBlock());
}
// Throws exception Row was updated or deleted by another transaction
service.save(aComponent);
//Each save is performed on a separate transaction
Any ideas?
|
|