[Dbix-class] RootClass DBIx::ContextualFetch

Bill Moseley moseley at hank.org
Mon Sep 28 15:19:51 GMT 2015


On Mon, Sep 28, 2015 at 2:45 AM, Will Crawford <billcrawford1970 at 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 <moseley at hank.org> wrote:
>
>>
>>
>> On Sat, Sep 26, 2015 at 8:54 AM, Peter Rabbitson <rabbit+dbic at 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
>> moseley at 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
moseley at hank.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.scsys.co.uk/pipermail/dbix-class/attachments/20150928/7b3b3280/attachment.htm>


More information about the DBIx-Class mailing list