We have assumed that the behavior described by James was there to prevent some concurrency problems without resorting to locks in the database.
With the current behavior, you can't delete an object unless the object you're deleting matches what's in the database. We have certainly run into our share of problems because of this behavior. But we've been reluctant to change it. Perhaps adding a deleteByPk() method to the generated Peers. -Eric On Wednesday, July 31, 2002, at 05:24 AM, Brekke, Jeff wrote: > +1 to patching. > > We've always just passed in our own criteria with just the primary key > specified. > So maybe if there is no primary key the current behavior is correct. > But if > a primary key is present, only use that? > > ================================================================= > Jeffrey D. Brekke Quad/Graphics > [EMAIL PROTECTED] http://www.qg.com > > >> -----Original Message----- >> From: James A. Hillyerd [mailto:[EMAIL PROTECTED]] >> Sent: Wednesday, July 31, 2002 3:17 AM >> To: Turbine Torque Developers List >> Subject: Torque's doDelete(obj) behavior >> >> >> I was looking through mountains of log entries the other day, and >> noticed that when I execute a call like: >> >> ObjPeer.doDelete(obj); >> >> Torque generates a where clause that includes every column/value pair, >> instead of just using the primary key. >> >> This has the side effect of not deleting the object if it has >> changed in >> the database since it was loaded by Torque. It also makes >> the database >> work harder, since it has to match every field, not just the PK. >> >> Is there any reason for Torque to work this way? Would >> people object to >> a patch to fix it (if possible)? >> >> -james >> >> -- >> [] James A. Hillyerd <[EMAIL PROTECTED]> - Java Software Engineer >> [] PGP 1024D/D31BC40D F87B 7906 C0DA 32E8 B8F6 DE23 FBF6 >> 4712 D31B C40D >> >> >> -- >> To unsubscribe, e-mail: >> <mailto:[EMAIL PROTECTED]> >> For additional commands, e-mail: >> <mailto:[EMAIL PROTECTED]> >> > > -- > To unsubscribe, e-mail: <mailto:turbine-torque-dev- > [EMAIL PROTECTED]> > For additional commands, e-mail: <mailto:turbine-torque-dev- > [EMAIL PROTECTED]> -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
