Skip Menu |

This queue is for tickets about the DBIx-DWIW CPAN distribution.

Report information
The Basics
Id: 49889
Status: open
Priority: 0/
Queue: DBIx-DWIW

People
Owner: Nobody in particular
Requestors: dsrthorne [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in:
  • 0.48
  • 0.49
Fixed in: (no value)



Subject: DBIx::DWIW::Begin() might conflict with DBI::begin_work()
This is seen on FreeBSD 7 with the following modules: p5-DBD-mysql50-4.006 bsdpan-DBIx-DWIW-0.48 (and I checked source for 0.49, it looks like it would suffer from this as well) bsdpan-DBI-1.607 I've been debugging a transaction issue wherein the Begin() fails with the error 'Already in a transaction' when there are no other transactions. After a great deal of gnashing of teeth and perl -d, I may have found the problem. It looks as if DWIW::Begin() sets AutoCommit to 0 and then calls DBI::begin_work(): sub Begin { ... eval { $self->{DBH}->{AutoCommit} = 0 }; $self->{DBH}->{mysql_auto_reconnect} = 0; return $self->{DBH}->begin_work; } This might be a problem because DBI::begin_work() checks for AutoCommit and assumes there is a previous transaction if AutoCommit is false: sub begin_work { my $dbh = shift; return $dbh->set_err($DBI::stderr, "Already in a transaction") unless $dbh->FETCH('AutoCommit'); $dbh->STORE('AutoCommit', 0); $dbh->STORE('BegunWork', 1); return 1; } I've tested behavior after removing the AutoCommit = 0 line from DBIx::DWIW::Begin and it seems to work properly, but I would greatly appreciate a second pair of eyes on this. Thanks!
BTW, here's my uname -a and perl -V: $ uname -a FreeBSD localhost 7.0-RELEASE-p5 FreeBSD 7.0-RELEASE-p5 #0: Wed Nov 19 00:20:22 UTC 2008 root@localhost:/usr/obj/usr/src/sys/CUSTOM amd64 $ perl -V Summary of my perl5 (revision 5 version 8 subversion 8) configuration: Platform: osname=freebsd, osvers=7.0-release-p5, archname=amd64-freebsd uname='freebsd dbs2.sjc1.bitgravity.com 7.0-release-p5 freebsd 7.0-release-p5 #0: wed nov 19 00:20:22 utc 2008 dwhite@dbs2.sjc1.bitgravity.com:usrobjusrsrcsysbitgravity amd64 ' config_args='-sde -Dprefix=/usr/local -Darchlib=/usr/local/lib/perl5/5.8.8/mach -Dprivlib=/usr/local/lib/perl5/5.8.8 -Dman3dir=/usr/local/lib/perl5/5.8.8/perl/man/man3 -Dman1dir=/usr/local/man/man1 -Dsitearch=/usr/local/lib/perl5/site_perl/5.8.8/mach -Dsitelib=/usr/local/lib/perl5/site_perl/5.8.8 -Dscriptdir=/usr/local/bin -Dsiteman3dir=/usr/local/lib/perl5/5.8.8/man/man3 -Dsiteman1dir=/usr/local/man/man1 -Ui_malloc -Ui_iconv -Uinstallusrbinperl -Dcc=cc -Duseshrplib -Dccflags=-DAPPLLIB_EXP="/usr/local/lib/perl5/5.8.8/BSDPAN" -Doptimize=-O2 -fno-strict-aliasing -pipe -Ud_dosuid -Ui_gdbm -Dusethreads=n -Dusemymalloc=y -Duse64bitint' hint=recommended, useposix=true, d_sigaction=define usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef useperlio=define d_sfio=undef uselargefiles=define usesocks=undef use64bitint=define use64bitall=define uselongdouble=undef usemymalloc=y, bincompat5005=undef Compiler: cc='cc', ccflags ='-DAPPLLIB_EXP="/usr/local/lib/perl5/5.8.8/BSDPAN" -DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H -fno-strict-aliasing -pipe -Wdeclaration-after-statement -I/usr/local/include', optimize='-O2 -fno-strict-aliasing -pipe', cppflags='-DAPPLLIB_EXP="/usr/local/lib/perl5/5.8.8/BSDPAN" -DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H -fno-strict-aliasing -pipe -Wdeclaration-after-statement -I/usr/local/include' ccversion='', gccversion='4.2.1 20070719 [FreeBSD]', gccosandvers='' intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16 ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8 alignbytes=8, prototype=define Linker and Libraries: ld='cc', ldflags =' -Wl,-E -L/usr/local/lib' libpth=/usr/lib /usr/local/lib libs=-lm -lcrypt -lutil perllibs=-lm -lcrypt -lutil libc=, so=so, useshrplib=true, libperl=libperl.so gnulibc_version='' Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' -Wl,-R/usr/local/lib/perl5/5.8.8/mach/CORE' cccdlflags='-DPIC -fPIC', lddlflags='-shared -L/usr/local/lib' Characteristics of this binary (from libperl): Compile-time options: MYMALLOC PERL_MALLOC_WRAP USE_64_BIT_ALL USE_64_BIT_INT USE_LARGE_FILES USE_PERLIO Locally applied patches: defined-or Built under freebsd Compiled at Dec 11 2008 23:35:19 @INC: /usr/local/lib/perl5/5.8.8/BSDPAN /usr/local/lib/perl5/site_perl/5.8.8/mach /usr/local/lib/perl5/site_perl/5.8.8 /usr/local/lib/perl5/site_perl /usr/local/lib/perl5/5.8.8/mach /usr/local/lib/perl5/5.8.8 .