Re: best practices when deleting

2006-04-11 Thread Anjo Krank
Am 11.04.2006 um 23:46 schrieb Chuck Hill: tdp.setTblDonorPhoneId(new Integer(2)); If TblDonorPhoneId is the actual PK then this is the problem. Remove the diamond icon in EOModeler and remove that code. Cheers, Anjo ___ Do not post admi

Re: best practices when deleting

2006-04-11 Thread Robert Walker
Stylistically, TblDonorPhone and TblDonor are freaking ugly names.  There are no Windows untyped resource handles here that need to be hacked around with naming conventions.  DonorPhone and Donor would be the customary names in WO.Or in some case prepending entity names with two capital letters as

Re: best practices when deleting

2006-04-11 Thread Chuck Hill
To expand on Ken's answer: On Apr 11, 2006, at 2:16 PM, WebObjects wrote: Chuck (and many regarded others), First, the error: [2006-04-11 13:57:20 PDT] com.webobjects.eoaccess.EOGeneralAdaptorException: deleteRowDescribedByQualifierEntity -- com.webobjects.jdbcadaptor.JDBCChannel: meth

Re: best practices when deleting

2006-04-11 Thread Robert Walker
One definite problem I see here is that you are manipulating the object before inserting it into the editing context. The purpose of the EOEditingContext is to track changes. It can't do that if the object is not inserted. Small correction: One responsibility of the EOEditingContext is t

Re: best practices when deleting

2006-04-11 Thread Robert Walker
Bill,One definite problem I see here is that you are manipulating the object before inserting it into the editing context.  The purpose of the EOEditingContext is to track changes.  It can't do that if the object is not inserted.        TblDonor newDonor = new TblDonor();        ec2.insertObject(ne

Re: best practices when deleting

2006-04-11 Thread Ken Anderson
Bill,You're not inserting the TblDonorPhone objects into the editing context.  You need to do that.Also, you should insert objects into the EC immediately after you instantiate them.Lastly, if TblDonorPhone has a relationship back to TblDonor, you should probably do:newDonor.addObjectToBothSidesOfR

Re: best practices when deleting

2006-04-11 Thread WebObjects
Title: Re: best practices when deleting Chuck (and many regarded others), First, the error: [2006-04-11 13:57:20 PDT] com.webobjects.eoaccess.EOGeneralAdaptorException: deleteRowDescribedByQualifierEntity -- com.webobjects.jdbcadaptor.JDBCChannel: method failed to delete row in database

Re: best practices when deleting

2006-04-11 Thread Robert Walker
Bill, It sounds to me like you may be holding onto (and attempting to use) references to deleted objects, either in a display group or other array containing references to your EO's. It's hard to say without more information like what exceptions are getting thrown, etc. It is my understa

Re: best practices when deleting

2006-04-11 Thread Chuck Hill
Hi Bill, On Apr 11, 2006, at 11:19 AM, WebObjects wrote: I’m getting ‘safe’ results when using “ec.refreshAllObjects();” prior to selecting and deleting objects from my database/entities. Without it I get all sorts of problems with context(s) not being in sync. I have no idea what sort o

best practices when deleting

2006-04-11 Thread WebObjects
WOCrew, I¹m getting Œsafe¹ results when using ³ec.refreshAllObjects();² prior to selecting and deleting objects from my database/entities. Without it I get all sorts of problems with context(s) not being in sync. Is there another or additional safe practice that I should be observing, to ensure