No queue support with the Sleepycat::Db Perl interface?

No queue support with the Sleepycat::Db Perl interface?

am 29.03.2006 02:03:35 von Kim Scheibel

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,
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_INIT_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