On Mon, Sep 28, 2015 at 2:45 AM, Will Crawford <billcrawford1...@gmail.com> wrote:
> I'd create some sort of proxy object that stores a ref to $schema and does > the ->dbh_do magic behind the scenes whenever you call a method on it ... > Frankly, I'm afraid to touch the legacy code much. The legacy code has its own DBI subclass that holds real DBI $dbh handles for master and slaves database servers and tracks master or slave in a global. Transactions are started automatically and the app code where a commit is called could be even in a different module than where the transaction was started. Nasty stuff. > > On 26 September 2015 at 18:23, Bill Moseley <mose...@hank.org> wrote: > >> >> >> On Sat, Sep 26, 2015 at 8:54 AM, Peter Rabbitson <rabbit+d...@rabbit.us> >> wrote: >> >> >>> Is there any problem with setting the RootClass as DBIx::ContextualFetch >>>> and running DBIC normally? >>>> >>> >>> I don't think there will be, but this has not been tested either. >> >> >> Thanks, Peter. >> >> >>> I would wrap the entire app call as: >>> >>> $storage->dbh_do(sub { app goes here using $_[1] } ) >>> >> >> I looked at that, but I guess I'm not clear how to use accomplish it >> since there's hundreds (if not thousands) of existing individual direct DBI >> calls in the app. >> >> >> Thanks, >> >> -- >> Bill Moseley >> mose...@hank.org >> >> _______________________________________________ >> List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class >> IRC: irc.perl.org#dbix-class >> SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/ >> Searchable Archive: >> http://www.grokbase.com/group/dbix-class@lists.scsys.co.uk >> > > > _______________________________________________ > List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class > IRC: irc.perl.org#dbix-class > SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/ > Searchable Archive: > http://www.grokbase.com/group/dbix-class@lists.scsys.co.uk > -- Bill Moseley mose...@hank.org
_______________________________________________ List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class IRC: irc.perl.org#dbix-class SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/ Searchable Archive: http://www.grokbase.com/group/dbix-class@lists.scsys.co.uk