The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.
Changes 120
MANIFEST 21
META.json 540
META.yml 2815
Makefile.PL 4618
README 053
README.md 540
lib/POE/Component/EasyDBI/SubProcess.pm 11
lib/POE/Component/EasyDBI.pm 3711
t/1.t 11
t/2.t 11
t/3.t 11
12 files changed (This is a version diff) 237102
@@ -1,17 +1,5 @@
 Revision history for POE::Component::EasyDBI.
 
-1.24
-    - Updated EasyDBI.pm to properly handle the case where the sending session
-      != event session (Stephan Jauernick)
-    - Fixed RT #45212, fix warnings in tests (Chris Williams)
-    - Fixed RT #32449, don't remove alias until child has been shut down
-      (Andy Grundman)
-    - Fixed RT #32448, setup_wheel should be called with call (Andy Grundman)
-    - Fixed RT #32447, combo query does not pass-through args (Andy Grundman)
-    - Fixed RT #30248, cpan install fails due to missing prereq
-    - Fixed RT #38456, typo in manpage 
-    - Added print_queue sub 
-
 1.23
     - alt_fork can be the path to your perl binary
       useful for forking inside of another app, like irssi
@@ -1,7 +1,7 @@
 Changes
 Makefile.PL
 MANIFEST
-README.md
+README
 README_TOO
 lib/POE/Component/EasyDBI.pm
 lib/POE/Component/EasyDBI/SubProcess.pm
@@ -10,4 +10,3 @@ t/1.t
 t/2.t
 t/3.t
 META.yml
-META.json                                Module JSON meta-data (added by MakeMaker)
@@ -1,54 +0,0 @@
-{
-   "abstract" : "Perl extension for asynchronous non-blocking DBI calls in POE",
-   "author" : [
-      "David Davis <xantus@cpan.org>"
-   ],
-   "dynamic_config" : 1,
-   "generated_by" : "ExtUtils::MakeMaker version 6.82, CPAN::Meta::Converter version 2.133380",
-   "license" : [
-      "perl_5"
-   ],
-   "meta-spec" : {
-      "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec",
-      "version" : "2"
-   },
-   "name" : "POE-Component-EasyDBI",
-   "no_index" : {
-      "directory" : [
-         "t",
-         "inc"
-      ]
-   },
-   "prereqs" : {
-      "build" : {
-         "requires" : {
-            "ExtUtils::MakeMaker" : "0"
-         }
-      },
-      "runtime" : {
-         "requires" : {
-            "Carp" : "0",
-            "DBI" : "1.38",
-            "Error" : "0.15",
-            "POE" : "0.20",
-            "Params::Util" : "0",
-            "Scalar::Util" : "0"
-         }
-      }
-   },
-   "release_status" : "stable",
-   "resources" : {
-      "bugtracker" : {
-         "web" : "https://rt.cpan.org/Public/Dist/Display.html?Name=POE-Component-EasyDBI"
-      },
-      "license" : [
-         "http://dev.perl.org/licenses/"
-      ],
-      "repository" : {
-         "type" : "git",
-         "url" : "https://github.com/gps4net/POE-Component-EasyDBI.git",
-         "web" : "https://github.com/gps4net/POE-Component-EasyDBI"
-      }
-   },
-   "version" : "1.24"
-}
@@ -1,29 +1,16 @@
----
-abstract: 'Perl extension for asynchronous non-blocking DBI calls in POE'
-author:
-  - 'David Davis <xantus@cpan.org>'
-build_requires:
-  ExtUtils::MakeMaker: 0
-dynamic_config: 1
-generated_by: 'ExtUtils::MakeMaker version 6.82, CPAN::Meta::Converter version 2.133380'
-license: perl
-meta-spec:
-  url: http://module-build.sourceforge.net/META-spec-v1.4.html
-  version: 1.4
-name: POE-Component-EasyDBI
-no_index:
-  directory:
-    - t
-    - inc
+# http://module-build.sourceforge.net/META-spec.html
+#XXXXXXX This is a prototype!!!  It will change in the future!!! XXXXX#
+name:         POE-Component-EasyDBI
+version:      1.23
+version_from: lib/POE/Component/EasyDBI.pm
+installdirs:  site
 requires:
-  Carp: 0
-  DBI: 1.38
-  Error: 0.15
-  POE: 0.20
-  Params::Util: 0
-  Scalar::Util: 0
-resources:
-  bugtracker: https://rt.cpan.org/Public/Dist/Display.html?Name=POE-Component-EasyDBI
-  license: http://dev.perl.org/licenses/
-  repository: https://github.com/gps4net/POE-Component-EasyDBI.git
-version: 1.24
+    Carp:                          
+    DBI:                           1.38
+    Error:                         0.15
+    Params::Util:                  
+    POE:                           0.20
+    Scalar::Util:                  
+
+distribution_type: module
+generated_by: ExtUtils::MakeMaker version 6.17
@@ -4,52 +4,24 @@ use ExtUtils::MakeMaker;
 # the contents of the Makefile that is written.
 
 WriteMakefile(
-    'NAME'         => 'POE::Component::EasyDBI',
-    'VERSION_FROM' => 'lib/POE/Component/EasyDBI.pm', # finds $VERSION
-    'PREREQ_PM'    => {
-        'POE' => ( ( $^O eq 'MSWin32' ) ? '0.3101' : '0.20' ),
-        'DBI' => '1.38',
-        'Error'        => '0.15',
-        'Carp'         => 0,
-        'Params::Util' => 0,
-        'Scalar::Util' => 0,
-        #'DBD::AnyData'	=> 0,
-    },
-    'dist' => {
-        'SUFFIX'       => ".gz",
-        'DIST_DEFAULT' => 'all tardist',
-        'COMPRESS'     => "gzip -9vf",
+    'NAME'			=> 'POE::Component::EasyDBI',
+    'VERSION_FROM'	=> 'lib/POE/Component/EasyDBI.pm', # finds $VERSION
+    'PREREQ_PM'		=> {
+		'POE'		=>	(($^O eq 'MSWin32') ? '0.3101' : '0.20'),
+		'DBI'		=>	'1.38',
+		'Error'		=>	'0.15',
+		'Carp'		=>	undef,
+        'Params::Util' => undef,
+        'Scalar::Util' => undef,
+#		'DBD::AnyData'	=>	'0',
     },
+	'dist'         => {
+		'SUFFIX'       => ".gz",
+		'DIST_DEFAULT' => 'all tardist',
+		'COMPRESS'     => "gzip -9vf",
+	},
 
-    (
-        $] >= 5.10.1
-        ? ## Add these new keywords supported since 5.10.1
-          (
-            ABSTRACT_FROM => 'lib/POE/Component/EasyDBI.pm', # retrieve abstract from module
-            LICENSE => 'perl_5',
-            AUTHOR  => 'David Davis <xantus@cpan.org>',
-            META_MERGE    => {
-                "meta-spec" => { version => 2 },
-                resources   => {
-					license => ['http://dev.perl.org/licenses/'],
-					bugtracker => {
-						web => 'https://rt.cpan.org/Public/Dist/Display.html?Name=POE-Component-EasyDBI',
-					},
-                    repository => {
-                        type => 'git',
-                        url  => 'https://github.com/gps4net/POE-Component-EasyDBI.git',
-                        web  => 'https://github.com/gps4net/POE-Component-EasyDBI'
-                    }
-                }
-            },
-          )
-        : $] >= 5.005
-        ? ## Add these new keywords supported since 5.005
-          (
-            ABSTRACT_FROM => 'lib/POE/Component/EasyDBI.pm', # retrieve abstract from module
-            LICENSE => 'perl_5',
-            AUTHOR  => 'David Davis <xantus@cpan.org>'
-          )
-        : ()
-    ),
+    ($] >= 5.005 ?    ## Add these new keywords supported since 5.005
+		(ABSTRACT_FROM	=> 'lib/POE/Component/EasyDBI.pm', # retrieve abstract from module
+		 AUTHOR			=> 'David Davis <xantus@cpan.org>') : ()),
 );
@@ -0,0 +1,53 @@
+POE::Component::EasyDBI
+===================================
+
+This module simplifies DBI usage in POE's multitasking world.
+
+This module is easy to use, you'll have DBI calls in your POE program
+up and running in no time.
+
+INSTALLATION
+
+To install this module type the following:
+
+   perl Makefile.PL
+   make
+   make test
+   make install
+
+DEPENDENCIES
+
+This module requires these other modules and libraries:
+
+	POE > 0.20
+		POE::Session
+		POE::Wheel::Run
+		POE::Filter::Reference
+		POE::Filter::Line
+
+	DBI > 1.30
+
+	Carp
+
+	Error > 0.15
+
+Optional:
+
+	SQLite
+		(for tests)
+
+AUTHOR
+
+David Davis <xantus@cpan.org>
+
+CREDITS
+
+Apocalypse <apocal@cpan.org>
+for POE::Component::SimpleDBI the basis of this PoCo
+	
+COPYRIGHT AND LICENCE
+
+Copyright 2003-2006 by David Davis and Teknikill Software
+
+This library is free software; you can redistribute it and/or modify
+it under the same terms as Perl itself.
@@ -1,54 +0,0 @@
-# POE::Component::EasyDBI
-
-This module simplifies DBI usage in POE's multitasking world.
-
-This module is easy to use, you'll have DBI calls in your POE program
-up and running in no time.
-
-# INSTALLATION
-
-To install this module type the following:
-
-   perl Makefile.PL
-   make
-   make test
-   make install
-
-# DEPENDENCIES
-
-This module requires these other modules and libraries:
-
-	POE > 0.20
-		POE::Session
-		POE::Wheel::Run
-		POE::Filter::Reference
-		POE::Filter::Line
-
-	DBI > 1.30
-
-	Carp
-
-	Error > 0.15
-
-Optional:
-
-	SQLite
-		(for tests)
-
-# AUTHOR
-
-David Davis <xantus@cpan.org>
-
-# CREDITS
-
-- Apocalypse <apocal@cpan.org>
-- Chris Williams <chris@bingosnet.co.uk>
-- Andy Grundman <andy@hybridized.org>
-- Stephan Jauernick <stephan@stejau.de>
-
-# COPYRIGHT AND LICENCE
-
-Copyright 2003-2006 by David Davis and Teknikill Software
-
-This library is free software; you can redistribute it and/or modify
-it under the same terms as Perl itself.
@@ -4,7 +4,7 @@ use strict;
 use warnings FATAL => 'all';
 
 # Initialize our version
-our $VERSION = '1.24';
+our $VERSION = '1.23';
 
 # Use Error.pm's try/catch semantics
 use Error qw( :try );
@@ -4,7 +4,7 @@ use strict;
 use warnings FATAL =>'all';
 
 # Initialize our version
-our $VERSION = '1.24';
+our $VERSION = '1.23';
 
 # Import what we need from the POE namespace
 use POE;
@@ -246,7 +246,6 @@ sub new {
                 # Queue handling
                 'send_query'    =>  'send_query',
                 'check_queue'   =>  'check_queue',
-                'print_queue'   =>  'print_queue',
             },
         ],
 
@@ -319,6 +318,11 @@ sub shutdown_poco {
             DEBUG && warn 'Duplicate shutdown NOW fired!';
             return;
         }
+    } else {
+        # Remove our alias so we can be properly terminated
+        $kernel->alias_remove($heap->{alias}) if ($heap->{alias} ne '');
+        # and the child
+        $kernel->sig( 'CHLD' );
     }
 
     # Check if we got "NOW"
@@ -407,13 +411,6 @@ sub combo_query {
 
     foreach my $i ( 0 .. $#{ $args->{queries} } ) {
         my ($type, $arg) = %{ $args->{queries}->[ $i ] };
-        
-        # Copy pass-through options
-        for my $key ( keys %{ $args } ) {
-            next if defined $arg->{$key} || $key eq 'queries';
-            $arg->{$key} = $args->{$key};
-        }
-        
         $arg->{event} = $handle;
         $arg->{__last} = ( $i == $#{ $args->{queries} } );
         $kernel->call( $_[SESSION] => $type => $arg );
@@ -547,12 +544,7 @@ sub db_handler {
     }
 
     # Increment the refcount for the session that is sending us this query
-    $kernel->refcount_increment($args->{session}, 'EasyDBI');
-    
-    if ($args->{session} ne $_[SENDER]->ID()) {
-        $kernel->refcount_increment($_[SENDER]->ID(), 'EasyDBI');
-        $args->{sendersession} = $_[SENDER]->ID();
-    }
+    $kernel->refcount_increment($_[SENDER]->ID(), 'EasyDBI');
 
     # Okay, fire off this query!
     $kernel->call($_[SESSION] => 'send_query' => $args);
@@ -618,11 +610,6 @@ sub check_queue {
     return;
 }
 
-sub print_queue {
-    my ($kernel, $heap) = @_[KERNEL,HEAP];
-    return scalar @{$heap->{queue}};
-}
-
 # This starts the EasyDBI
 sub start {
     my ($kernel, $heap) = @_[KERNEL,HEAP];
@@ -631,7 +618,7 @@ sub start {
     $kernel->alias_set($heap->{alias}) if ($heap->{alias} ne '');
     
     # Create the wheel
-    $kernel->call( $_[SESSION] => 'setup_wheel' );
+    $kernel->yield('setup_wheel');
     
     return;
 }
@@ -938,10 +925,6 @@ sub child_STDOUT {
     if ($refcount_decrement) {
         $heap->{active} = 0;
         $kernel->refcount_decrement($query_copy->{session}, 'EasyDBI');
-        
-        if (defined($query_copy->{sendersession}) && $query_copy->{sendersession} ne $query_copy->{session}) {
-            $kernel->refcount_decrement($query_copy->{sendersession}, 'EasyDBI');    
-        }
 
         # Now, that we have got a result, check if we need to send another query
         $kernel->call($_[SESSION], 'check_queue');
@@ -963,17 +946,8 @@ sub child_STDERR {
 }
 
 sub sig_child {
-    my ($kernel, $heap) = @_[KERNEL, HEAP];
-    
-    delete $heap->{wheel_pid};
-    $kernel->sig_handled();
-    
-    if ( $heap->{shutdown} ) {
-        # Remove our alias so we can be properly terminated
-        $kernel->alias_remove($heap->{alias}) if ($heap->{alias} ne '');
-        # and the child
-        $kernel->sig( 'CHLD' );
-    }
+    delete $_[HEAP]->{wheel_pid};
+    $_[KERNEL]->sig_handled();
 }
 
 # ----------------
@@ -1233,7 +1207,7 @@ or
     $kernel->post( 'EasyDBI',
         quote => {
                 sql => 'foo$*@%%sdkf"""',
-                event => $_[SESSION]->postback("quoted_handler"),
+                event => $_[SESSION]->postack("quoted_handler"),
                 session => 'dbi_helper', # or session id
         }
     );
@@ -239,7 +239,7 @@ SKIP: {
 				];
 				my $d = $_[ARG0]->{result};
 				for my $i ( 0 .. $#{$r} ) {
-					foreach my $k (keys %{$r->[$i]}) {
+					foreach my $k (keys %{$r->[i]}) {
 						unless ($r->[$i]->{$k} eq $d->[$i]->{$k}) {
 							$_[ARG0]->{error} = "incorrect data in $i ($k)";
 						}
@@ -263,7 +263,7 @@ SKIP: {
 				];
 				my $d = $_[ARG0]->{result};
 				for my $i ( 0 .. $#{$r} ) {
-					foreach my $k (keys %{$r->[$i]}) {
+					foreach my $k (keys %{$r->[i]}) {
 						unless ($r->[$i]->{$k} eq $d->[$i]->{$k}) {
 							$_[ARG0]->{error} = "incorrect data in $i ($k)";
 						}
@@ -265,7 +265,7 @@ SKIP: {
 				];
 				my $d = $_[ARG0]->{result};
 				for my $i ( 0 .. $#{$r} ) {
-					foreach my $k (keys %{$r->[$i]}) {
+					foreach my $k (keys %{$r->[i]}) {
 						unless ($r->[$i]->{$k} eq $d->[$i]->{$k}) {
 							$_[ARG0]->{error} = "incorrect data in $i ($k)";
 						}