On my DAO I would not return anything but on my Gateway I would return a value containing the number of rows updated / deleted but do so as a number and not a string. That way I'm seperating information about the number of updates / deletes from how I choose to express it to the user. In both cases I would throw an exception is something went wrong but transaction control would be determined by the situation. Roll back all vs commit and review / fix errors afterwards.
Cheers, Pete (aka lad4bear)
----Original Message Follows---- From: "Dave Merrill" <[EMAIL PROTECTED]> Reply-To: [email protected] To: <[email protected]> Subject: RE: [CFCDev] What does a DAO delete method return? Date: Mon, 2 May 2005 11:41:12 -0400
Thanks for all the feedback everyone. It seems my instincts aren't in the mainstream here (:-).
Couple questions:
- Do other data access methods that don't return actual data (save and update) typically return anything?
- It was questioned whether delete belonged in a DAO at all, since it acts
on multiple rows. Nothing further came of that part of the conversation. Any
comments?
Along those same lines, where would you put a multi-row update? That seems
very analogous to a multi-row delete.
Dave Merrill
----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email to [email protected] with the words 'unsubscribe cfcdev' as the subject of the email.
CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting (www.cfxhosting.com).
An archive of the CFCDev list is available at www.mail-archive.com/[email protected]
---------------------------------------------------------- You are subscribed to cfcdev. To unsubscribe, send an email to [email protected] with the words 'unsubscribe cfcdev' as the subject of the email.
CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting (www.cfxhosting.com).
An archive of the CFCDev list is available at www.mail-archive.com/[email protected]
