Skip Menu |

This queue is for tickets about the Apache-DBI CPAN distribution.

Report information
The Basics
Id: 17463
Status: resolved
Priority: 0/
Queue: Apache-DBI

People
Owner: pgollucci [...] p6m7g8.com
Requestors: clinton [...] traveljury.com
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.9901
Fixed in: (no value)



Subject: Apache::DBI issues repeat AutoCommit
I am running MP2 with Apache::DBI, DBI 1.50 and DBD::mysql 3.0002. For each request that is issued, both DBI and Apache::DBI try to reset the state. The result is that you see two "set autocommit=1" statements for every request.
I just don't see this. You're probably right, you'll have to give me more info as to where you see this, and what you are doing. FreeBSD 6.1RELEASE perl 5.8.8 w/out ithreads httpd 2.2.2 prefork apr is not threaded mod_perl2 svn trunk Apache::DBI svn trunk (to-be 1.00_01) DBD::mysql 3.004 DBI 1.50 mysql 5.1.9-beta
package TEST::Apache::DBI; use strict; use warnings FATAL => 'all'; use Carp; use Data::Dumper; use DBI; use Apache2::RequestRec (); use Apache2::RequestIO (); use Apache2::Const -compile => qw(OK); our %db_attrs = ( RaiseError => 1, PrintError => 0, Taint => 1, AutoCommit => 0, LongReadLen => 50000, LongTruncOk => 1, ShowErrorStatement => 1, ChopBlanks => 1, FetchHashKeyName => "NAME_lc", ); sub handler { my $r = shift; my $dbh = eval { DBI->connect('DBI:mysql:database=test', 'test', undef, \%db_attrs) }; if ($@) { $r->print("Connect: $@\n"); } else { $r->print("Connected\n"); my $sth = $dbh->prepare("SELECT * FROM users"); $sth->execute(); while (my $hashref = $sth->fetchrow_hashref()) { $r->print(Dumper $hashref); } eval { $dbh->do("INSERT INTO users (username, password) VALUES (?,?)", \%db_attrs, (time(), time())); }; if ($@) { $dbh->rollback(); } else { $dbh->commit(); } my $rc = $dbh->disconnect(); unless ($rc) { $r->print("RC: $rc\n"); } else { $r->print("Disconnected\n"); } } return Apache2::Const::OK; }
use Apache2::Status (); use Apache::DBI (); $Apache::DBI::DEBUG = 2; ## My Modules use TEST::Apache::DBI (); ## Init code our %db_attrs = ( RaiseError => 1, PrintError => 0, Taint => 1, AutoCommit => 0, LongReadLen => 50000, LongTruncOk => 1, ShowErrorStatement => 1, ChopBlanks => 1, FetchHashKeyName => "NAME_lc", ); Apache::DBI->connect_on_init("DBI:mysql:database=test", "test", undef, \%db_attrs); 1;
Download mod_perl.conf
application/octet-stream 109b

Message body not shown because it is not plain text.