We noticed an unexpected behaviour with Castor 1.3.1 and Castor 1.3.3 RC1.
We use lazy loading for
collections. When we load an object (the "parent object")
in read-only method the elements ("child objects") in
collections for that object
are not read-only.
That is changes to parent object attributes are not persistent,
changes to the child
objects attributes are persistent.
When we disable the lazy loading for collections the child
object are read-only as
Is this behaviour actually expected that lazy loaded collections are not read-only
even if the parent object is read-only?
in pseudo code:
ParentPO parentPO = org.exolab.castor.jdo.Database.load
(ParentPO.class, id, Database.READONLY);
ChildrenPO childrenPO = parentPO.getChildren().iterator().next(); //assuming
non empty list
parentPO.setParentName("name change"); // change is not persistent
change"); // change is persistent
I hope the attach gives more detailed information.
thanks very much for your
attention, best regards