Hi again, actually I was too optimistic, it's work without exception , but only for my test ( when I store object and then get it by query ). when I trying to get previously stored object I got null as value of referenced member :(.
One thing to be careful of when you see behavior like this is the caching mechanism. By default OJB does not update cascade/delete cascade. This is important because the reference for a collection is stored in the database on the object IN the collection, instead of in the collection. As long as the PB is retrieving from a cache the Collection instance belonging to the cached object will be used, but once it leaves the cache, boom. I haven't had a chance to really explore the exact behaviors, but I have seen grief and woe from it myself.
When using the PB API (the only one I have really used) I tend to go ahead and set up cascades for dependent objects (wholly dependent entities anyway).
Anyway, one thing I have found helps to find these for me early is to always flush the cache after writes in my unit tests. In theory you could change to an empty cache implementation for testing, but flushing the cache at the end of setUp() is easy and more accurate for what you want in most cases.
-Brian
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
