Hi Mark,

Looking through the code for transfer one would expect objects that
have been discarded not to exist in the cache. However, I ran a simple
unit test overnight and it proved otherwise. As suggested I made the
Transfer.isCached() method public. The test involved randomly loading
1000 parent objects and their child collections. Once everything was
loaded I looped back through those objects discarding each parent as
well as each child. The final iteration simply called the isCached()
method and, if it found the object in cache, wrote a line to the
console. Of the 1000 parent objects and their several thousand child
objects there were 25 hits on the cache when there should have been
zero. This would suggest to me something is amiss.

Thoughts?

Mick

On Aug 12, 9:27 am, Mark Mandel <mark.man...@gmail.com> wrote:
> 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-qu...
>
> > 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...@google 
> groups.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