Hello all.  I'm working on modeling a many-to-many relationship with some
meta-data stored in the map table.  Here's the relationship definition:

$meta->relationship(subscribed_lists => {
                                       type          => 'many to many',
                                       map_class => 'My::UserListMap',
                                       query_args => [is_subscribed => 1],
                    });

This selects the list of My::List objects which have is_subscribed = 1 in
the map table.  Works great:

@lists = $user->subscribed_lists();

My problem is that this code seem to return stale results if I do any update
to the map table.  For example:

My::UserListMap::Manager->update_user_list_maps(
                                             set   => {is_subscribed => 0},
                                             where => [
                                                       user_id => $user_id,
                                                       list_id => [EMAIL 
PROTECTED]
                                                      ]);

After that I can make an existing $user object return correct results my
reloading it:

$user = My::User->new(user_id => $user->user_id)->load();
@lists = $user->subscribed_lists();

But without the reload subscribed_lists() keeps returning the old list.  Is
there a way to tip off Rose that any cached lists for a particular
relationship are stale?  Or something I'm doing wrong?

Thanks for the help.

-sam
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Rose-db-object mailing list
Rose-db-object@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rose-db-object

Reply via email to