*** DBI.pm 2008-12-09 11:37:23.718368200 -0600
--- newDBI.pm 2008-12-09 11:35:36.030487680 -0600
***************
*** 13,18 ****
--- 13,19 ----
use POE qw( Component::Pool::Thread );
use DBI;
use threads::shared;
+ use Data::Dumper;
use constant {
DEBUG => 0,
REFCOUNT_IDENTIFIER => "queries",
***************
*** 28,35 ****
# For tracking the job id.
$self->{current_id} = 0;
! use Data::Dumper;
! print Dumper($self);
print "Connections: $args{connections}";
--- 29,35 ----
# For tracking the job id.
$self->{current_id} = 0;
! print Dumper($self) if DEBUG;
print "Connections: $args{connections}";
***************
*** 190,196 ****
if (defined $callback) {
if (DEBUG) {
- use Data::Dumper;
print "dispatching response ($caller, $callback)",
Dumper(\@results);
--- 190,195 ----
***************
*** 221,237 ****
my ($kernel, $heap) = @_[ KERNEL, HEAP ];
my $dbpool = POE::Component::Pool::DBI->new(
! MaxConnections => 10,
! DSN => "DBI:mysql:database=test",
! Username => "username",
! Password => "password"
);
# Outstanding queries keep the calling session alive.
$dbpool->query(
callback => "handle_result",
query => "select foo from bar where foo = ?",
! args => [ "foo" ],
userdata => "example"
);
--- 220,236 ----
my ($kernel, $heap) = @_[ KERNEL, HEAP ];
my $dbpool = POE::Component::Pool::DBI->new(
! connections => 10,
! dsn => "DBI:mysql:database=test",
! username => "username",
! password => "password"
);
# Outstanding queries keep the calling session alive.
$dbpool->query(
callback => "handle_result",
query => "select foo from bar where foo = ?",
! params => [ "foo" ],
userdata => "example"
);
***************
*** 255,261 ****
# important.
$dbpool->do(
query => "INSERT INTO results (query, count) VALUES (?,?)",
! args => [ $udata, @$results ],
);
# Ask for a clean shutdown.
--- 254,260 ----
# important.
$dbpool->do(
query => "INSERT INTO results (query, count) VALUES (?,?)",
! params=> [ $udata, @$results ],
);
# Ask for a clean shutdown.
***************
*** 329,335 ****
will be invoked immediately, but it will be cached within the connection
(see L<DBI> prepare_cached).
! =item args
The arguments to provide to DBI's execute method (see L<DBI>).
--- 328,334 ----
will be invoked immediately, but it will be cached within the connection
(see L<DBI> prepare_cached).
! =item params
The arguments to provide to DBI's execute method (see L<DBI>).