Date: | Tue, 19 Mar 2002 13:30:49 -0500 |
From: | Jeff Wasilko <jeffw [...] smoe.org> |
To: | Paul.Marquess [...] btinternet.com |
Cc: | bug-berkeleydb [...] rt.cpan.org |
Subject: | BerkeleyDB module question |
Hi Paul:
I'm seeing some strange errors from db_close() and c_close(), and
I was wondering if you might be able to offer some guidance as I
try to figure out what's wrong.
Firstly, this is what I'm running:
mila{jwasilko}337: perl -MBerkeleyDB -e 'print "BerkeleyDB ver $BerkeleyDB::VERSION\n"'
BerkeleyDB ver 0.18
mila{jwasilko}338: perl -MBerkeleyDB -e 'print BerkeleyDB::DB_VERSION_STRING."\n"'
Sleepycat Software: Berkeley DB 3.3.11: (July 12, 2001)
As far as db_close, I've got a little test program that always
fails to close the database:
#!/local/bin/perl -w
use BerkeleyDB;
$env = new BerkeleyDB::Env
-Home => "/var/db/jwasilko/active_probe",
-Verbose => 1,
-Flags => DB_CREATE|DB_INIT_CDB|DB_INIT_MPOOL;
$db1 = new BerkeleyDB::Btree
-Filename => "test.db",
-Env => $env,
-Flags => DB_CREATE;
$db1->db_put("one", $ARGV[0]);
$db1->db_close()
or die "Cannot close file test.db: $! $BerkeleyDB::Error\n" ;
****
mila{jwasilko}196: ./db1.pl hiddd
Cannot close file test.db:
*******
The other thing I'm chasing is that in my app, when I call
c_close to close a cursor using:
$cursor->c_close()
or warn "Cannot close cursor $cursor: $! $BerkeleyDB::Error\n" ;
I often get a similar error:
Cannot close cursor BerkeleyDB::Cursor=ARRAY(0x10b900):
Both of these seem to be caused by the library not returning
anything on success (if it is really succeeding).
Lastly, I'm getting "Write attempted on read-only cursor" errors
when I call c_close() or db_close(), but I'm not sure why. I
don't have a simple example that reproduces it yet, but I was
wondering if you had any suggestions?
Thanks!
-jeff