in reply to Dynamically change tables for Class::DBI
Class::DBI keeps track of which objects you have in memory. See the "UNIQUENESS OF OBJECTS IN MEMORY" section of the docs for an explanation. You can either turn off this feature, or just remove the object from memory before trying to fetch it again. Here's an example:
my $foo = FooBar->retrieve(1); print $foo->name(), "\n"; # remove the instance of FooBar with an ID of 1 from memory undef $foo; FooBar->table('Bar'); #switch table my $bar1 = FooBar->retrieve(1);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Dynamically change tables for Class::DBI
by johnnywang (Priest) on Feb 18, 2005 at 21:45 UTC | |
by perrin (Chancellor) on Feb 18, 2005 at 21:55 UTC |