[Dbix-class] DBIx::Class 0.08100 released to CPAN

Peter Rabbitson rabbit+dbic at rabbit.us
Tue Apr 21 07:00:23 GMT 2009


John Napiorkowski wrote:
> BTW, I notice some people using ->discard_changes in place of reload_from_storage.  Please don't since this breaks replication support.  
> 
> John

Um... what is reload_from_storage?

rabbit at Thesaurus:~/devel/dbic/0.08/trunk$ grep -rc reload_from_storage ./lib | grep -v ":0$"
./lib/DBIx/Class/ResultSource.pm:1

which just says:

            $self->throw_exception(
              "Column ${v} not loaded or not passed to new() prior to insert()"
                ." on ${for} trying to resolve relationship (maybe you forgot "
                  ."to call ->reload_from_storage to get defaults from the db)"
            );

OTOH discard_changes is all over the code:

rabbit at Thesaurus:~/devel/dbic/0.08/trunk$ grep -rc discard_changes ./lib | grep -v ":0$"
./lib/DBIx/Class/PK.pm:3
./lib/DBIx/Class/Manual/FAQ.pod:5
./lib/DBIx/Class/Manual/Intro.pod:1
./lib/DBIx/Class/Row.pm:6
./lib/DBIx/Class/Ordered.pm:2
./lib/DBIx/Class/Storage/DBI/Replicated.pm:1
./lib/DBIx/Class/CDBICompat/LazyLoading.pm:1

As a matter of fact in Replicated.pm Gotchas section you yourself advocate
use of discard_changes...

What gives?



More information about the DBIx-Class mailing list