Our team is working with 0.9.3.9 and are having a strange problem:

classes:
-A-  1 to n  -B-

A's mapping includes a sql-many key to B.  This mapping looks like it works
fine.  The B composite object is loaded correctly when the A object is
loaded.  When we create a new A object using our application, the new A
object is loaded correctly when we use Castor to load all A objects.

However, when we create a new B object and then use Castor to create the
object in the database we run into our problem.  The database is updated
with our object and the correct information.  When we try to look at the new
B on our application, Castor fails to load the new B object.  We're pretty
sure it's because Castor thinks that A hasn't changed (since we didn't
update an A object, we just added a B) and doesn't bother to go look at the
database.

To try to solve this, we tried multiple things but have settled on this for
now:
Use "cache-type" to tell Castor to never cache the A object:
<class ... >
  <cache-type type="none"/>
  ...
</class>

This is working fine for our development purposes but I doubt it will be the
best solution for a production environment because we're not using Castor's
caching efficiency.

I'm thinking that the best way to solve this problem is in our business
logic somehow indicate to castor that the A object is now dirty after we
update an associated B object.  Any suggestions?

Thanks,
-- 
Chris Williams
[EMAIL PROTECTED]

----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-dev

Reply via email to