Steven Mackenzie wrote:
> Matt S Trout wrote:
>
>> Steven Mackenzie wrote:
>>
>>
>>> Matt S Trout wrote:
>>>
>>>
>>> I've tried replacing the DBBase->set_db() call with a call to
>>> DBBase->connection(), but then I get this error the first time I try to
>>> use one of my CDBI classes:
>>> Can't call method "storage" on an undefined value at
>>> C:/Perl/site/lib/DBIx/Class/ResultSource.pm line 411.
>>>
>>> Has this every come up before? I didn't find anything in the mailing
>>> list archive ...
>>>
>>>
>> Without seeing more of your code I can't easily debug; my best guess would
>> be
>> you're calling that after the class tree's loaded rather than in the
>> DBBase.pm
>> file during use base.
>>
>>
> Yes, that's exactly what I do -- worked fine with CDBI :-(
>
> Unfortunately, my app constructs a new DSN at each run-time from user
> input. Is there a way that I can still use CDBICompat and set the
> connection information at run time?
Right. DBIC makes this easier for main usage by allowing schema objects
(multiple connections per class tree :D).
Have a look at the docs for DBIx::Class::DB which describes the workaround
required for this.
--
Matt S Trout Offering custom development, consultancy and support
Technical Director contracts for Catalyst, DBIx::Class and BAST. Contact
Shadowcat Systems Ltd. mst (at) shadowcatsystems.co.uk for more information
+ Help us build a better perl ORM: http://dbix-class.shadowcatsystems.co.uk/ +
_______________________________________________
List: http://lists.rawmode.org/cgi-bin/mailman/listinfo/dbix-class
Wiki: http://dbix-class.shadowcatsystems.co.uk/
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/trunk/DBIx-Class/
Searchable Archive: http://www.mail-archive.com/[email protected]/