Alex, Thanks for the response. This looks like this will provide what I need, and solve my problem. Is there a reason that one would want to leave the container in the default setting (not sync-on-commit-only)? Is there a performance benefit. It seems very odd to me that the specification would ignore the benefits of a NOT NULL foreign key.
Perhaps I am missing something! Thanks Troy --- Date: Sat, 2 Aug 2003 16:31:57 +0300 From: Alexey Loubyansky <[EMAIL PROTECTED]> Organization: JBoss Group, LLC To: "Poppe, Troy" <[EMAIL PROTECTED]> Subject: Re: [JBoss-user] CMR remove results in UPDATE? (which fails because of NOT NULL c onstraint) Reply-To: [EMAIL PROTECTED] Hello Troy, by default, JBoss follows the spec strictly. By the spec, before entity instance is removed physically, all the relationships the instance participates in must be destroyed. You can treat it differently. But there are two things: destroying relationships in object model and in the data store. By default, JBoss destroys relationships in both: object model and data store. You can turn on sync-on-commit-only in container configuration and relationships will be destroyed in object model only and on commit only DELETE should be executed. alex Friday, August 01, 2003, 8:36:12 PM, Troy Poppe wrote: PT> Hello, PT> I have defined a bi-directional one-to-many CMR between two EJBs, PerformancePlan PT> and AssignedPerformanceElement. In my database, the FK field (PerformancePlanID) PT> in AssignedPerformanceElement is defined as NOT NULLable. PT> In my code, I am trying to remove an AssignedPerformanceElement from a PT> PerformancePlan, and I make my ValueObject (from XDoclet) to reflect this. When PT> I set this value object on the PerformancePlan, it attempts to call remove() on a PT> AssignedPerformanceElement instance. PT> In the console log, I get the following: PT> 11:40:01,090 DEBUG [AssignedPerformanceElement] Executing SQL: UPDATE PT> ASSIGNEDPERFORMANCEELEMENT SET performancePlanID=? WHERE PT> assignedPerformanceElementID=? PT> 11:40:01,131 INFO [STDOUT] p6spy - 1059752401131|41|3|statement|UPDATE PT> ASSIGNEDPERFORMANCEELEMENT SET performancePlanID=? WHERE PT> assignedPerformanceElementID=?|UPDATE ASSIGNEDPERFORMANCEELEMENT SET PT> performancePlanID='' WHERE assignedPerformanceElementID='170' PT> 11:40:01,211 ERROR [LogInterceptor] TransactionRolledbackLocalException, PT> causedBy: PT> java.sql.SQLException: ORA-01407: cannot update PT> ("HR"."ASSIGNEDPERFORMANCEELEMENT"."PERFORMANCEPLANID") to NULL PT> First, why is JBoss trying to UPDATE to remove the AssignedPerformanceElement? PT> Shouldn't this be a DELETE instead? PT> What am I missing? Is there anything in the documentation (I bought the whole PT> subscription set! I highly recommend it to anyone who hasnt bought it yet.) PT> Thanks PT> Troy Poppe PT> ------------------------------------------------------- PT> This SF.Net email sponsored by: Free pre-built ASP.NET sites including PT> Data Reports, E-commerce, Portals, and Forums are available now. PT> Download today and enter to win an XBOX or Visual Studio .NET. PT> http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01 PT> _______________________________________________ PT> JBoss-user mailing list PT> [EMAIL PROTECTED] PT> https://lists.sourceforge.net/lists/listinfo/jboss-user --__--__-- _______________________________________________ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user End of JBoss-user Digest ------------------------------------------------------- This SF.Net email sponsored by: Free pre-built ASP.NET sites including Data Reports, E-commerce, Portals, and Forums are available now. Download today and enter to win an XBOX or Visual Studio .NET. http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01 _______________________________________________ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user