I'm having a problem removing objects in a 1:N relationship in OJB 1.0.4
using OMDG. Assume you have an object Role that can have one or more
Permission objects. If I lock just the Role object for WRITE, remove a
Permission object from this Role, and then commit the transaction I'll
get the following exception:
Caused by: org.apache.ojb.odmg.TransactionAbortedExceptionOJB: Can't
commit objects: Unexpected behaviour, unregistered object to delete:
Permission[1]
In OJB.properties ImplicitLocking=false and Ordering=true. The
collection descriptor in the Role class descriptor looks something like
the following:
<collection-descriptor name="permissions"
element-class-ref="org.test.Permission" proxy="true"
collection-class="org.apache.ojb.broker.util.collections.RemovalAwareLis
t" auto-delete="object" auto-update="none">
<inverse-foreignkey field-id-ref="2"/>
</collection-descriptor>
Locking the Permission object before removing it seems to solve the
problem. Any ideas? Please let me know if you need any additional
information. Thanks in advance for the help,
--Phil
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]