[Catalyst-commits] r6373 - in trunk/Catalyst-Model-DBI: .
lib/Catalyst/Helper/Model lib/Catalyst/Model
alex at dev.catalyst.perl.org
alex at dev.catalyst.perl.org
Tue May 8 02:43:08 GMT 2007
Author: alex
Date: 2007-05-08 02:43:06 +0100 (Tue, 08 May 2007)
New Revision: 6373
Modified:
trunk/Catalyst-Model-DBI/Changes
trunk/Catalyst-Model-DBI/lib/Catalyst/Helper/Model/DBI.pm
trunk/Catalyst-Model-DBI/lib/Catalyst/Model/DBI.pm
Log:
reverting back to 0.15 as per Evan Caroll request, model behaving as expected
Modified: trunk/Catalyst-Model-DBI/Changes
===================================================================
--- trunk/Catalyst-Model-DBI/Changes 2007-05-07 15:59:44 UTC (rev 6372)
+++ trunk/Catalyst-Model-DBI/Changes 2007-05-08 01:43:06 UTC (rev 6373)
@@ -1,4 +1,6 @@
Revision history for Perl extension Catalyst::Model::DBI.
+0.18 Mon May 07 18:40:00 2007
+ - reverting back to 0.15 as per Evan Caroll request, model behaving as expected
0.17 Mon May 07 08:00:00 2007
- made $self->_pid($$) "non lazy", fixed a few things
0.16 Sun May 06 14:48:00 2007
Modified: trunk/Catalyst-Model-DBI/lib/Catalyst/Helper/Model/DBI.pm
===================================================================
--- trunk/Catalyst-Model-DBI/lib/Catalyst/Helper/Model/DBI.pm 2007-05-07 15:59:44 UTC (rev 6372)
+++ trunk/Catalyst-Model-DBI/lib/Catalyst/Helper/Model/DBI.pm 2007-05-08 01:43:06 UTC (rev 6373)
@@ -3,7 +3,7 @@
use strict;
use File::Spec;
-our $VERSION = '0.17';
+our $VERSION = '0.18';
=head1 NAME
Modified: trunk/Catalyst-Model-DBI/lib/Catalyst/Model/DBI.pm
===================================================================
--- trunk/Catalyst-Model-DBI/lib/Catalyst/Model/DBI.pm 2007-05-07 15:59:44 UTC (rev 6372)
+++ trunk/Catalyst-Model-DBI/lib/Catalyst/Model/DBI.pm 2007-05-08 01:43:06 UTC (rev 6373)
@@ -5,7 +5,7 @@
use NEXT;
use DBI;
-our $VERSION = '0.17';
+our $VERSION = '0.18';
__PACKAGE__->mk_accessors( qw/_dbh _pid _tid/ );
@@ -51,15 +51,12 @@
sub new {
my $self = shift;
- my ( $c ) = @_;
- $self = $self->NEXT::new( @_ );
+ my ($c) = @_;
+ $self = $self->NEXT::new(@_);
$self->{namespace} ||= ref $self;
$self->{additional_base_classes} ||= ();
$self->{log} = $c->log;
$self->{debug} = $c->debug;
- $self->_pid ( $$ );
- my $dbh;
- $self->{__dbh} = \$dbh;
return $self;
}
@@ -69,20 +66,18 @@
sub stay_connected {
my $self = shift;
- $self->_dbh( ${$self->{__dbh}} );
if ( $self->_dbh ) {
- if ( $self->_tid && threads->tid && $self->_tid != threads->tid ) {
- $self->_dbh( $self->connect );
+ if ( defined $self->_tid && $self->_tid != threads->tid ) {
+ $self->_dbh ( $self->connect );
} elsif ( $self->_pid != $$ ) {
$self->_dbh->{InactiveDestroy} = 1;
- $self->_dbh( $self->connect );
+ $self->_dbh ( $self->connect );
} elsif ( ! $self->connected ) {
- $self->_dbh( $self->connect );
+ $self->_dbh ( $self->connect );
}
} else {
- $self->_dbh( $self->connect );
+ $self->_dbh ( $self->connect );
}
- ${$self->{__dbh}} = $self->_dbh;
return $self->_dbh;
}
@@ -105,7 +100,6 @@
if ($@) { $self->{log}->debug( qq{Couldn't connect to the database "$@"} ) if $self->{debug} }
else { $self->{log}->debug ( 'Connected to the database via dsn:' . $self->{dsn} ) if $self->{debug}; }
$self->_pid ( $$ );
- $self->{__pid} = $$;
$self->_tid ( threads->tid ) if $INC{'threads.pm'};
return $dbh;
}
More information about the Catalyst-commits
mailing list