[Dbix-class] Bug in Catalyst::Model::DBIC::Schema ?

Oleg Pronin syber.rus at gmail.com
Mon Aug 31 09:29:45 GMT 2009


ammm... yes. it is needed for daemon servers (in my case - mmo game
servers). Sometimes database goes down for 10-15 secs due to network
failure or gets restarted by admin (30 secs downtime). Game server
should not feel it, it handles thousands of gamers online with huge
amount of game data in memory. It is better for him to get blocked a
while than die. Original DBIC's storage reconnect have only one try
but this is not enough. DBIx::Retry can handle configurable number of
reconnect tries with some interval. It transparent for DBIC and it's
own reconnect mechanism never initiated.

Of course in case of web only site without online servers it is not
needed and original DBIC's mechanism is fully acceptable.

2009/8/29 Rafael Kitover <rkitover at io.com>:
> By the way, DBIC does its own seemless retry on disconnects.
>
> Does DBIx::RetryOverDisconnect offer anything special aside from this?
>
> On Wed, Aug 26, 2009 at 10:43:22PM +0400, Oleg Pronin wrote:
>> Hello.
>>
>> I've just upgraded to last cat & dbic & related and i get error with my model.
>> I use custom DBI class for my DB connection persistence
>>
>> package Myapp::Model::General;
>> use parent 'Catalyst::Model::DBIC::Schema';
>> use strict;
>> use DBIx::RetryOverDisconnects;
>>
>> __PACKAGE__->config(
>>     schema_class => 'Myapp::Schema',
>>     connect_info => [
>>         sub {DBIx::RetryOverDisconnects->connect(...)},
>>         {
>>             quote_char => q{"},
>>             name_sep   => q{.},
>>         },
>>     ],
>> );
>>
>> DBIx::Class::Storage::DBI docs:
>> A single code reference which returns a connected DBI database handle
>> optionally followed by extra attributes recognized by DBIx::Class:
>>   $connect_info_args = [ sub { DBI->connect (...) }, \%extra_attributes? ];
>>
>>
>> But with newest Catalyst::Model::DBIC::Schema i get error:
>>
>> Couldn't instantiate component "Myapp::Model::General", "invalid
>> connect_info at
>> /usr/local/lib/perl5/site_perl/5.10.1/Catalyst/Model/DBIC/Schema/Types.pm
>> line 86.
>>
>> It seems that Catalyst/Model/DBIC/Schema/Types.pm does not support SUB
>> REF in connect info anymore. Is that a bug or feature ?
>>
>> Thanks.
>
> _______________________________________________
> 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
>



More information about the DBIx-Class mailing list