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?
> 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?
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.
> 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.
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:
> 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 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:
> 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:
> > 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 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: >> 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:
>> > 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 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:
> >> 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:
> >> > 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.