r27996 - in /branches/upstream/librose-db-perl/current: ./ lib/Rose/ lib/Rose/DB/ lib/Rose/DB/Cache/ lib/Rose/DB/Registry/
bricas-guest at users.alioth.debian.org
bricas-guest at users.alioth.debian.org
Wed Dec 10 13:33:47 UTC 2008
Author: bricas-guest
Date: Wed Dec 10 13:33:43 2008
New Revision: 27996
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=27996
Log:
[svn-upgrade] Integrating new upstream version, librose-db-perl (0.748)
Modified:
branches/upstream/librose-db-perl/current/Changes
branches/upstream/librose-db-perl/current/META.yml
branches/upstream/librose-db-perl/current/lib/Rose/DB.pm
branches/upstream/librose-db-perl/current/lib/Rose/DB/Cache.pm
branches/upstream/librose-db-perl/current/lib/Rose/DB/Cache/Entry.pm
branches/upstream/librose-db-perl/current/lib/Rose/DB/Constants.pm
branches/upstream/librose-db-perl/current/lib/Rose/DB/Generic.pm
branches/upstream/librose-db-perl/current/lib/Rose/DB/Informix.pm
branches/upstream/librose-db-perl/current/lib/Rose/DB/MySQL.pm
branches/upstream/librose-db-perl/current/lib/Rose/DB/Oracle.pm
branches/upstream/librose-db-perl/current/lib/Rose/DB/Pg.pm
branches/upstream/librose-db-perl/current/lib/Rose/DB/Registry.pm
branches/upstream/librose-db-perl/current/lib/Rose/DB/Registry/Entry.pm
branches/upstream/librose-db-perl/current/lib/Rose/DB/SQLite.pm
Modified: branches/upstream/librose-db-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/librose-db-perl/current/Changes?rev=27996&op=diff
==============================================================================
--- branches/upstream/librose-db-perl/current/Changes (original)
+++ branches/upstream/librose-db-perl/current/Changes Wed Dec 10 13:33:43 2008
@@ -1,3 +1,9 @@
+0.748 (12.09.2008) - John Siracusa <siracusa at gmail.com>
+
+ * Fixed mod_perl 2.x support in Rose::DB::Cache. (Reported by
+ Kostas Chatzikokolakis)
+ * Resolved ambiguous driver_class link in POD.
+
0.747 (10.22.2008) - Justin Ellison <justin at techadvise.com>
* Changed to require YAML instead of YAML::Syck, though YAML::Syck
Modified: branches/upstream/librose-db-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/librose-db-perl/current/META.yml?rev=27996&op=diff
==============================================================================
--- branches/upstream/librose-db-perl/current/META.yml (original)
+++ branches/upstream/librose-db-perl/current/META.yml Wed Dec 10 13:33:43 2008
@@ -1,6 +1,6 @@
--- #YAML:1.0
name: Rose-DB
-version: 0.747
+version: 0.748
abstract: ~
author: []
license: perl
@@ -14,6 +14,7 @@
DateTime::Format::MySQL: 0
DateTime::Format::Pg: 0.11
DBI: 0
+ perl: 5.006000
Rose::DateTime::Util: 0.532
Rose::Object: 0.82
Scalar::Util: 0
@@ -30,7 +31,7 @@
directory:
- t
- inc
-generated_by: ExtUtils::MakeMaker version 6.47_02
+generated_by: ExtUtils::MakeMaker version 6.48
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
version: 1.4
Modified: branches/upstream/librose-db-perl/current/lib/Rose/DB.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/librose-db-perl/current/lib/Rose/DB.pm?rev=27996&op=diff
==============================================================================
--- branches/upstream/librose-db-perl/current/lib/Rose/DB.pm (original)
+++ branches/upstream/librose-db-perl/current/lib/Rose/DB.pm Wed Dec 10 13:33:43 2008
@@ -20,7 +20,7 @@
our $Error;
-our $VERSION = '0.747';
+our $VERSION = '0.748';
our $Debug = 0;
@@ -2507,7 +2507,7 @@
(These attributes use the L<inheritable_scalar|Rose::Class::MakeMethods::Generic/inheritable_scalar> method type as defined in L<Rose::Class::MakeMethods::Generic>.)
-=item B<driver_class>, B<default_connect_options>
+=item B<driver_class, default_connect_options>
These hashes of attributes are inherited by subclasses using a one-time, shallow copy from a superclass. Any subclass that accesses or manipulates the hash in any way will immediately get its own private copy of the hash I<as it exists in the superclass at the time of the access or manipulation>.
@@ -3441,7 +3441,7 @@
John C. Siracusa (siracusa at gmail.com)
-=head1 COPYRIGHT
+=head1 LICENSE
Copyright (c) 2008 by John C. Siracusa. All rights reserved. This program is
free software; you can redistribute it and/or modify it under the same terms
Modified: branches/upstream/librose-db-perl/current/lib/Rose/DB/Cache.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/librose-db-perl/current/lib/Rose/DB/Cache.pm?rev=27996&op=diff
==============================================================================
--- branches/upstream/librose-db-perl/current/lib/Rose/DB/Cache.pm (original)
+++ branches/upstream/librose-db-perl/current/lib/Rose/DB/Cache.pm Wed Dec 10 13:33:43 2008
@@ -7,7 +7,7 @@
use Scalar::Util qw(refaddr);
use Rose::DB::Cache::Entry;
-our $VERSION = '0.745';
+our $VERSION = '0.748';
our $Debug = 0;
@@ -23,6 +23,8 @@
__PACKAGE__->entry_class('Rose::DB::Cache::Entry');
__PACKAGE__->default_use_cache_during_apache_startup(0);
+our($MP2_Is_Child);
+
sub default_use_cache_during_apache_startup
{
my($class) = shift;
@@ -118,7 +120,7 @@
{
my($self, $db) = @_;
- # Don't cache anythign during apache startup if use_cache_during_apache_startup
+ # Don't cache anything during apache startup if use_cache_during_apache_startup
# is false. Weird conditional structure is meant to encourage code elimination
# thanks to the lone constants in the if/elsif conditions.
if(MOD_PERL_1)
@@ -132,9 +134,9 @@
}
elsif(MOD_PERL_2)
{
- if(Apache2::ServerUtil::restart_count() == 1 && !$self->use_cache_during_apache_startup)
- {
- $Debug && warn "Refusing to cache $db during apache server start-up ",
+ unless($MP2_Is_Child && !$self->use_cache_during_apache_startup)
+ {
+ $Debug && warn "Refusing to cache $db in pre-fork apache process ",
"because use_cache_during_apache_startup is false";
return $db;
}
@@ -157,6 +159,15 @@
if(MOD_PERL_2)
{
require Apache2::ServerUtil;
+ require Apache2::RequestUtil;
+
+ $MP2_Is_Child = 0;
+
+ Apache2::ServerUtil->server->push_handlers(PerlChildInitHandler => sub
+ {
+ $Debug && warn "$$ is MP2 child\n";
+ $MP2_Is_Child = 1;
+ });
}
sub prepare_db
@@ -202,7 +213,8 @@
# Not a chained elsif to help Perl eliminate the unused code (maybe unnecessary?)
if(MOD_PERL_2)
{
- if(Apache2::ServerUtil::restart_count() == 1) # server starting
+ #if(is_first_pid_at_current_restart_count)
+ if(!$MP2_Is_Child)
{
$entry->created_during_apache_startup(1);
$entry->prepared(0);
@@ -225,12 +237,29 @@
return;
}
- Apache2::ServerUtil->server->push_handlers(PerlCleanupHandler => sub
+ my $r;
+
+ eval { $r = Apache2::RequestUtil->request };
+
+ if($@)
{
- $Debug && warn "$$ Clear dbh and prepared flag for $db, $entry\n";
- $db->dbh(undef) if($db);
- $entry->prepared(0) if($entry);
- });
+ $Debug && warn "Couldn't get apache request (restart count is ",
+ Apache2::ServerUtil::restart_count(), ")\n";
+
+ $entry->created_during_apache_startup(1); # tag for cleanup
+ $entry->prepared(0);
+
+ return;
+ }
+ else
+ {
+ $r->push_handlers(PerlCleanupHandler => sub
+ {
+ $Debug && warn "$$ Clear dbh and prepared flag for $db, $entry\n";
+ $db->dbh(undef) if($db);
+ $entry->prepared(0) if($entry);
+ });
+ }
$entry->prepared(1);
}
@@ -280,7 +309,15 @@
L<Rose::DB::Cache> provides both an API and a default implementation of a caching system for L<Rose::DB> objects. Each L<Rose::DB>-derived class L<references|Rose::DB/db_cache> a L<Rose::DB::Cache>-derived object to which it delegates cache-related activities. See the L<new_or_cached|Rose::DB/new_or_cached> method for an example.
-The default implementation caches and returns L<Rose::DB> objects using the combination of their L<type|Rose::DB/type> and L<domain|Rose::DB/domain> as the cache key. There is no cache expiration or other cache cleaning. The only sophistication in the default implementation is that it is L<mod_perl>- and L<Apache::DBI>-aware: it will do the right thing during apache server start-up and will ensure that L<Apache::DBI>'s "ping" and rollback features work as expected, keeping the L<DBI> database handles L<contained|Rose::DB/dbh> within each L<Rose::DB> object connected and alive. Both mod_perl 1.x and 2.x are supported.
+The default implementation caches and returns L<Rose::DB> objects using the combination of their L<type|Rose::DB/type> and L<domain|Rose::DB/domain> as the cache key. There is no cache expiration or other cache cleaning.
+
+The only sophistication in the default implementation is that it is L<mod_perl>- and L<Apache::DBI>-aware. When running under mod_perl, with or without L<Apache::DBI>, the L<dbh|Rose::DB/dbh> attribute of each cached L<Rose::DB> object is set to C<undef> at the end of each request. Additionally, any db connections made in a pre-fork parent apache process are not cached.
+
+When running under L<Apache::DBI>, the behavior described above will ensure that L<Apache::DBI>'s "ping" and rollback features work as expected, keeping the L<DBI> database handles L<contained|Rose::DB/dbh> within each L<Rose::DB> object connected and alive.
+
+When running under mod_perl I<without> L<Apache::DBI>, the behavior described above will use a single L<DBI> database connection per cached L<Rose::DB> object per request, but will discard these connections at the end of each request.
+
+Both mod_perl 1.x and 2.x are supported. Under mod_perl 2.x, you I<must> load L<Rose::DB> on server startup (e.g., in your C<startup.pl> file).
Subclasses can override any and all methods described below in order to implement their own caching strategy.
@@ -404,7 +441,7 @@
John C. Siracusa (siracusa at gmail.com)
-=head1 COPYRIGHT
+=head1 LICENSE
Copyright (c) 2008 by John C. Siracusa. All rights reserved. This program is
free software; you can redistribute it and/or modify it under the same terms
Modified: branches/upstream/librose-db-perl/current/lib/Rose/DB/Cache/Entry.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/librose-db-perl/current/lib/Rose/DB/Cache/Entry.pm?rev=27996&op=diff
==============================================================================
--- branches/upstream/librose-db-perl/current/lib/Rose/DB/Cache/Entry.pm (original)
+++ branches/upstream/librose-db-perl/current/lib/Rose/DB/Cache/Entry.pm Wed Dec 10 13:33:43 2008
@@ -94,7 +94,7 @@
John C. Siracusa (siracusa at gmail.com)
-=head1 COPYRIGHT
+=head1 LICENSE
Copyright (c) 2008 by John C. Siracusa. All rights reserved. This program is
free software; you can redistribute it and/or modify it under the same terms
Modified: branches/upstream/librose-db-perl/current/lib/Rose/DB/Constants.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/librose-db-perl/current/lib/Rose/DB/Constants.pm?rev=27996&op=diff
==============================================================================
--- branches/upstream/librose-db-perl/current/lib/Rose/DB/Constants.pm (original)
+++ branches/upstream/librose-db-perl/current/lib/Rose/DB/Constants.pm Wed Dec 10 13:33:43 2008
@@ -39,7 +39,7 @@
John C. Siracusa (siracusa at gmail.com)
-=head1 COPYRIGHT
+=head1 LICENSE
Copyright (c) 2008 by John C. Siracusa. All rights reserved. This program is
free software; you can redistribute it and/or modify it under the same terms
Modified: branches/upstream/librose-db-perl/current/lib/Rose/DB/Generic.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/librose-db-perl/current/lib/Rose/DB/Generic.pm?rev=27996&op=diff
==============================================================================
--- branches/upstream/librose-db-perl/current/lib/Rose/DB/Generic.pm (original)
+++ branches/upstream/librose-db-perl/current/lib/Rose/DB/Generic.pm Wed Dec 10 13:33:43 2008
@@ -73,7 +73,7 @@
John C. Siracusa (siracusa at gmail.com)
-=head1 COPYRIGHT
+=head1 LICENSE
Copyright (c) 2008 by John C. Siracusa. All rights reserved. This program is
free software; you can redistribute it and/or modify it under the same terms
Modified: branches/upstream/librose-db-perl/current/lib/Rose/DB/Informix.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/librose-db-perl/current/lib/Rose/DB/Informix.pm?rev=27996&op=diff
==============================================================================
--- branches/upstream/librose-db-perl/current/lib/Rose/DB/Informix.pm (original)
+++ branches/upstream/librose-db-perl/current/lib/Rose/DB/Informix.pm Wed Dec 10 13:33:43 2008
@@ -1070,7 +1070,7 @@
John C. Siracusa (siracusa at gmail.com)
-=head1 COPYRIGHT
+=head1 LICENSE
Copyright (c) 2008 by John C. Siracusa. All rights reserved. This program is
free software; you can redistribute it and/or modify it under the same terms
Modified: branches/upstream/librose-db-perl/current/lib/Rose/DB/MySQL.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/librose-db-perl/current/lib/Rose/DB/MySQL.pm?rev=27996&op=diff
==============================================================================
--- branches/upstream/librose-db-perl/current/lib/Rose/DB/MySQL.pm (original)
+++ branches/upstream/librose-db-perl/current/lib/Rose/DB/MySQL.pm Wed Dec 10 13:33:43 2008
@@ -759,7 +759,7 @@
John C. Siracusa (siracusa at gmail.com)
-=head1 COPYRIGHT
+=head1 LICENSE
Copyright (c) 2008 by John C. Siracusa. All rights reserved. This program is
free software; you can redistribute it and/or modify it under the same terms
Modified: branches/upstream/librose-db-perl/current/lib/Rose/DB/Oracle.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/librose-db-perl/current/lib/Rose/DB/Oracle.pm?rev=27996&op=diff
==============================================================================
--- branches/upstream/librose-db-perl/current/lib/Rose/DB/Oracle.pm (original)
+++ branches/upstream/librose-db-perl/current/lib/Rose/DB/Oracle.pm Wed Dec 10 13:33:43 2008
@@ -378,6 +378,6 @@
John C. Siracusa (siracusa at gmail.com), Ron Savage (ron at savage.net.au)
-=head1 COPYRIGHT
+=head1 LICENSE
Copyright (c) 2008 by John Siracusa and Ron Savage. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Modified: branches/upstream/librose-db-perl/current/lib/Rose/DB/Pg.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/librose-db-perl/current/lib/Rose/DB/Pg.pm?rev=27996&op=diff
==============================================================================
--- branches/upstream/librose-db-perl/current/lib/Rose/DB/Pg.pm (original)
+++ branches/upstream/librose-db-perl/current/lib/Rose/DB/Pg.pm Wed Dec 10 13:33:43 2008
@@ -654,7 +654,7 @@
John C. Siracusa (siracusa at gmail.com)
-=head1 COPYRIGHT
+=head1 LICENSE
Copyright (c) 2008 by John C. Siracusa. All rights reserved. This program is
free software; you can redistribute it and/or modify it under the same terms
Modified: branches/upstream/librose-db-perl/current/lib/Rose/DB/Registry.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/librose-db-perl/current/lib/Rose/DB/Registry.pm?rev=27996&op=diff
==============================================================================
--- branches/upstream/librose-db-perl/current/lib/Rose/DB/Registry.pm (original)
+++ branches/upstream/librose-db-perl/current/lib/Rose/DB/Registry.pm Wed Dec 10 13:33:43 2008
@@ -341,7 +341,7 @@
John C. Siracusa (siracusa at gmail.com)
-=head1 COPYRIGHT
+=head1 LICENSE
Copyright (c) 2008 by John C. Siracusa. All rights reserved. This program is
free software; you can redistribute it and/or modify it under the same terms
Modified: branches/upstream/librose-db-perl/current/lib/Rose/DB/Registry/Entry.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/librose-db-perl/current/lib/Rose/DB/Registry/Entry.pm?rev=27996&op=diff
==============================================================================
--- branches/upstream/librose-db-perl/current/lib/Rose/DB/Registry/Entry.pm (original)
+++ branches/upstream/librose-db-perl/current/lib/Rose/DB/Registry/Entry.pm Wed Dec 10 13:33:43 2008
@@ -235,7 +235,7 @@
John C. Siracusa (siracusa at gmail.com)
-=head1 COPYRIGHT
+=head1 LICENSE
Copyright (c) 2008 by John C. Siracusa. All rights reserved. This program is
free software; you can redistribute it and/or modify it under the same terms
Modified: branches/upstream/librose-db-perl/current/lib/Rose/DB/SQLite.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/librose-db-perl/current/lib/Rose/DB/SQLite.pm?rev=27996&op=diff
==============================================================================
--- branches/upstream/librose-db-perl/current/lib/Rose/DB/SQLite.pm (original)
+++ branches/upstream/librose-db-perl/current/lib/Rose/DB/SQLite.pm Wed Dec 10 13:33:43 2008
@@ -616,7 +616,7 @@
John C. Siracusa (siracusa at gmail.com)
-=head1 COPYRIGHT
+=head1 LICENSE
Copyright (c) 2008 by John C. Siracusa. All rights reserved. This program is
free software; you can redistribute it and/or modify it under the same terms
More information about the Pkg-perl-cvs-commits
mailing list