Stupid question, why not just do a check with some sql, rather than user a
try/catch?

Sent from my mobile device

On 12 Aug 2010 03:48, "Brian G" <brian-goo...@vfive.com> wrote:
> I have this try-delete-fall-back-to-soft-delete code:
>
> <cfset var clubmember = getClubMember(arguments.uidClubMember) />
> <cftry>
> <cfset variables.transfer.delete(clubmember) />
> <cfreturn true />
>
> <cfcatch type="any">
> <!--- there are FK dependencies, so mark as deleted --->
> <cfset clubmember.setClubMemberStatus(getClubMemberStatusDeleted()) /
>>
> <cfset variables.transfer.save(clubmember) />
> <cfreturn false />
> </cfcatch>
> </cftry>
>
> My object is member o2m clubmember. There are instances where the SQL
> delete fails for referential integrity reasons but it happens AFTER
> the parent has been removed so when I try to set the status and save,
> the parent ID is already set to null.
>
> Would cloning the clubmember before deleting resolve this condition?
> Any other suggestions?
>
>
> Brian
>
> --
> Before posting questions to the group please read:
>
http://groups.google.com/group/transfer-dev/web/how-to-ask-support-questions-on-transfer
>
> Try out the new Transfer ORM Custom Google Search:
> http://www.google.com/cse/home?cx=002375903941309441958:2s7wbd5ocb8
>
> You received this message because you are subscribed to the Google Groups
"transfer-dev" group.
> To post to this group, send email to transfer-dev@googlegroups.com
> To unsubscribe from this group, send email to
transfer-dev+unsubscr...@googlegroups.com<transfer-dev%2bunsubscr...@googlegroups.com>
> For more options, visit this group at
http://groups.google.com/group/transfer-dev?hl=en

-- 
Before posting questions to the group please read:
http://groups.google.com/group/transfer-dev/web/how-to-ask-support-questions-on-transfer

Try out the new Transfer ORM Custom Google Search:
http://www.google.com/cse/home?cx=002375903941309441958:2s7wbd5ocb8

You received this message because you are subscribed to the Google Groups 
"transfer-dev" group.
To post to this group, send email to transfer-dev@googlegroups.com
To unsubscribe from this group, send email to 
transfer-dev+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/transfer-dev?hl=en

Reply via email to