Skip Menu |

This queue is for tickets about the DBM-Deep CPAN distribution.

Report information
The Basics
Id: 60903
Status: resolved
Priority: 0/
Queue: DBM-Deep

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

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



Subject: Transactions broken with arrayref
64-bit Perl 5.10.1 on Windows 7 After the following code runs, many entries of @$ar are undefined (seemingly, always the same ones). Those which are defined have the expected values. If the begin_work and commit lines are removed, the problem does not occur. my $db = DBM::Deep->new('myfile.db'); # new file $db->put('k1',[]); my $ar = $db->{'k1'}; $db->begin_work; for my $i (0..99) {$ar->[$i] = $i;} # or push(@$ar,$i) $db->commit;
On Tue Aug 31 00:01:41 2010, nillsollers wrote: Show quoted text
> 64-bit Perl 5.10.1 on Windows 7 > > After the following code runs, many entries of @$ar are undefined > (seemingly, always the same ones). Those which are defined have the > expected values. If the begin_work and commit lines are removed, the > problem does not occur. > > my $db = DBM::Deep->new('myfile.db'); # new file > $db->put('k1',[]); > my $ar = $db->{'k1'}; > $db->begin_work; > for my $i (0..99) {$ar->[$i] = $i;} # or push(@$ar,$i) > $db->commit;
I know this is weird: You have to create your database with num_txns set to a value >= 2: my $db = DBM::Deep->new(name => 'myfile.db', num_txns => 2); Simple access to a database, regardless of how many processes are doing it, already counts as one transaction. So, if you want, say, 5 processes to be able to call begin_work at the same time, num_txns must be at least 6. And it must be set when the database is first created. The real bug is that DBM::Deep will bonnily proceed to corrupt the database if too many transactions are opened. So I’ve fixed this in 2.0002. Thank you for the report.
Subject: Re: [rt.cpan.org #60903] Transactions broken with arrayref
Date: Sun, 5 Sep 2010 21:44:43 -0400
To: bug-DBM-Deep [...] rt.cpan.org
From: Stephen Corwin <stephen.corwin [...] gmail.com>
Thank you! On Sun, Sep 5, 2010 at 3:41 PM, Father Chrysostomos via RT < bug-DBM-Deep@rt.cpan.org> wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=60903 > > > On Tue Aug 31 00:01:41 2010, nillsollers wrote:
> > 64-bit Perl 5.10.1 on Windows 7 > > > > After the following code runs, many entries of @$ar are undefined > > (seemingly, always the same ones). Those which are defined have the > > expected values. If the begin_work and commit lines are removed, the > > problem does not occur. > > > > my $db = DBM::Deep->new('myfile.db'); # new file > > $db->put('k1',[]); > > my $ar = $db->{'k1'}; > > $db->begin_work; > > for my $i (0..99) {$ar->[$i] = $i;} # or push(@$ar,$i) > > $db->commit;
> > I know this is weird: You have to create your database with num_txns set to > a value >= 2: > > my $db = DBM::Deep->new(name => 'myfile.db', num_txns => 2); > > Simple access to a database, regardless of how many processes are doing it, > already counts as > one transaction. So, if you want, say, 5 processes to be able to call > begin_work at the same > time, num_txns must be at least 6. And it must be set when the database is > first created. > > The real bug is that DBM::Deep will bonnily proceed to corrupt the database > if too many > transactions are opened. So I’ve fixed this in 2.0002. Thank you for the > report. > >
-- ------------------------------------- Stephen Corwin Professor Mathematics and Statistics Department Radford University www.radford.edu/math-web ------------------------------------- NOTICE: This e-mail message and any attachment to this e-mail message are intended only for the person(s) named above and may contain proprietary and/or confidential information that may be legally privileged. If you are not the intended recipient, you must not review, retransmit, convert to hard copy, copy, use or disseminate this e-mail or any attachments to it. If you have received this e-mail in error, please immediately delete this message entirely from your computer.