Google Groups Home
Help | Sign in
Cached manytomany problem?
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  12 messages - Collapse all
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
Casey Corcoran  
View profile
 More options May 5, 12:51 pm
From: Casey Corcoran <casey.corco...@gmail.com>
Date: Mon, 05 May 2008 12:51:07 -0400
Local: Mon, May 5 2008 12:51 pm
Subject: Cached manytomany problem?
Support Info:
CF8, Transfer 1.0, SQL Server 2005, Windows Server 2003

I'm sure I'm misunderstanding something, but here's my problem:

I have a Category object which has a manytomany relationship with a
Course object, and the Course object in turn has a manytomany
relationship with the Category object, both through the join table
CategoryCourses. When I add a Course to a Category:
myCategory.addcourses(myCourse) it works fine however on my edit Course
page I have a listing of which Category the Course is in and this only
gets updated if I reset the application. I'm using lazy loading on both
sides, how do I make sure they stay in sync in the cache?

Thanks in advance,
Casey


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mark Mandel  
View profile
 More options May 5, 2:15 pm
From: "Mark Mandel" <mark.man...@gmail.com>
Date: Mon, 5 May 2008 13:15:28 -0500
Local: Mon, May 5 2008 2:15 pm
Subject: Re: [transfer-dev] Cached manytomany problem?
Casey,

From what I think you're asking - you're trying to do bidrectional manytomany?

You can only do one set of configuration per relationship, so
bideirectional manytomany is not supported.

It is something that people have discussed in the past, so it may be
considered for the future.

Mark

On Mon, May 5, 2008 at 11:51 AM, Casey Corcoran

--
E: mark.man...@gmail.com
W: www.compoundtheory.com

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Casey Corcoran  
View profile
 More options May 5, 3:07 pm
From: Casey Corcoran <casey.corco...@gmail.com>
Date: Mon, 05 May 2008 15:07:04 -0400
Local: Mon, May 5 2008 3:07 pm
Subject: Re: [transfer-dev] Re: Cached manytomany problem?
That sounds right Mark, I figured I was just misunderstanding the way it
worked, for now I'm just making sure both directions get updated at the
same time.

Thanks!
Casey


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
r.tugwell@forthmedia.com  
View profile
 More options May 8, 1:57 pm
From: "r.tugw...@forthmedia.com" <r.tugw...@forthmedia.com>
Date: Thu, 8 May 2008 10:57:05 -0700 (PDT)
Local: Thurs, May 8 2008 1:57 pm
Subject: Re: Cached manytomany problem?

> That sounds right Mark, I figured I was just misunderstanding the way it
> worked, for now I'm just making sure both directions get updated at the
> same time.

Hi Casey - I have the same situation. How are you forcing the updates?
For example if I have a save event I am looping through the children
by ID doing a discard(), get(), addManyToMany() however I'm not sure
if this is the best approach. Serialisation is something I haven't
considered yet either. The caching mechanisms certainly turbo-charge
everything, but I'm having trouble getting my head around it.

Cheers

Richard


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Casey Corcoran  
View profile
 More options May 8, 2:01 pm
From: Casey Corcoran <casey.corco...@gmail.com>
Date: Thu, 08 May 2008 14:01:16 -0400
Local: Thurs, May 8 2008 2:01 pm
Subject: Re: [transfer-dev] Re: Cached manytomany problem?
I just ended up doing something like this:

category.addCourses( course );
course.addCategories( category );
transfer.save(category);
transfer.save(course);

I put checks in to make sure they didn't have the relationship already,
then the remove is the same idea just with remove instead of add.

Hope that helps!

Casey


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
r.tugwell@forthmedia.com  
View profile
 More options May 8, 2:21 pm
From: "r.tugw...@forthmedia.com" <r.tugw...@forthmedia.com>
Date: Thu, 8 May 2008 11:21:27 -0700 (PDT)
Local: Thurs, May 8 2008 2:21 pm
Subject: Re: Cached manytomany problem?
Ah - so you don't actually have ManyToMany relationships, but
OneToMany on either side with the join table?

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Casey Corcoran  
View profile
 More options May 8, 2:24 pm
From: Casey Corcoran <casey.corco...@gmail.com>
Date: Thu, 08 May 2008 14:24:29 -0400
Local: Thurs, May 8 2008 2:24 pm
Subject: Re: [transfer-dev] Re: Cached manytomany problem?
Well, it's a manytomany on both sides so in theory they should stay
synced up, but the caching spoils that plan. :)

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
r.tugwell@forthmedia.com  
View profile
 More options May 8, 2:31 pm
From: "r.tugw...@forthmedia.com" <r.tugw...@forthmedia.com>
Date: Thu, 8 May 2008 11:31:21 -0700 (PDT)
Local: Thurs, May 8 2008 2:31 pm
Subject: Re: Cached manytomany problem?
Ok - cheers - and thanks for pointing this out in the first place

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Brian Kotek  
View profile
 More options May 8, 2:31 pm
From: "Brian Kotek" <brian...@gmail.com>
Date: Thu, 8 May 2008 14:31:24 -0400
Local: Thurs, May 8 2008 2:31 pm
Subject: Re: [transfer-dev] Re: Cached manytomany problem?

You *can't* do bidirectional relationships with any of the link types and
use the cache. Even without the cache there may be issues lurking but I'm
not positive. The bottom line is: don't do this.

On Mon, May 5, 2008 at 3:07 PM, Casey Corcoran <casey.corco...@gmail.com>
wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
r.tugwell@forthmedia.com  
View profile
 More options May 8, 3:18 pm
From: "r.tugw...@forthmedia.com" <r.tugw...@forthmedia.com>
Date: Thu, 8 May 2008 12:18:42 -0700 (PDT)
Local: Thurs, May 8 2008 3:18 pm
Subject: Re: Cached manytomany problem?
Thanks Brian - it's a pity though. There are a lot of real life many-
to-many situations where the objects on both side have equal claims on
composition and it "seems" to work... but I'll take your word for it!

On May 8, 8:31 pm, "Brian Kotek" <brian...@gmail.com> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mark Mandel  
View profile
 More options May 8, 5:40 pm
From: "Mark Mandel" <mark.man...@gmail.com>
Date: Fri, 9 May 2008 07:40:03 +1000
Local: Thurs, May 8 2008 5:40 pm
Subject: Re: [transfer-dev] Re: Cached manytomany problem?
I've written down a short spec for a bidirectional m2m, but nothing is
set in stone yet.

Mark

On Fri, May 9, 2008 at 5:18 AM, r.tugw...@forthmedia.com

--
E: mark.man...@gmail.com
W: www.compoundtheory.com

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
r.tugwell@forthmedia.com  
View profile
 More options May 8, 11:08 pm
From: "r.tugw...@forthmedia.com" <r.tugw...@forthmedia.com>
Date: Thu, 8 May 2008 20:08:05 -0700 (PDT)
Local: Thurs, May 8 2008 11:08 pm
Subject: Re: Cached manytomany problem?
Thanks Mark

On May 8, 11:40 pm, "Mark Mandel" <mark.man...@gmail.com> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2008 Google