For Programmers: Free Programming Magazines  


Home > Archive > PERL Modules > March 2006 > No queue support with the Sleepycat::Db Perl interface?









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author No queue support with the Sleepycat::Db Perl interface?
Kim Scheibel

2006-03-28, 6:57 pm

I've been unsuccessful in trying to use the queue table type with the
Sleepycat::Db interface and I cannot figure out why.

===
use Sleepycat::Db;

my $db = new Db();
$db->open(undef, "test.db", undef, Db::DB_QUEUE, Db::DB_CREATE);

my($k, $v) = ('', 'test value');

$db->put($k, $v, Db::DB_APPEND);
===
results in:
Db::_put() -- txnid is not an object reference at (eval 2) line 13,
<DATA> line 345.

(transactions aren't configured, obviously)

No luck _with_ transactions either:
===
use Sleepycat::Db;

eval {
my $env = new DbEnv;
$env->open('testenv',
Db::DB_CREATE|Db::DB_INIT_MPOOL|Db::DB_I
NIT_TXN|Db::DB_INIT_LOCK,
0666);

my $db = new Db($env);
$db->open(undef, "test.db", undef, Db::DB_QUEUE,
Db::DB_CREATE|Db::DB_AUTO_COMMIT);

my($k, $v) = ('', 'test value');

my $txn = $env->txn_begin;
$db->put($txn, $k, $v, Db::DB_APPEND);
$txn->commit;
};

if($@) {
print $@->what, "\n";
}

===
Db::put: Invalid argument in test_queue_txn, line 18

I've tried a number of other ways with much the same result. Does
anyone know if queues are just not supported by Sleepycat::Db?

/Kim

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com