Subject: | DBI st handle 0x1d57af8 cleared whilst still active. |
Date: | Fri, 18 Sep 2015 09:31:38 +0100 |
To: | bug-DBD-Cassandra [...] rt.cpan.org |
From: | Vytautas D <vytdau [...] gmail.com> |
Not sure if I am missing something here, but I am always getting
following error:
DBI st handle 0x1d57af8 cleared whilst still active.
dbih_clearcom (sth 0x1d57af8, com 0x1d678f0, imp DBD::Cassandra::st):
FLAGS 0x180115: COMSET Active Warn PrintError PrintWarn
PARENT DBI::db=HASH(0x1d57630)
KIDS 0 (0 Active)
NUM_OF_FIELDS 0
NUM_OF_PARAMS 2
following code always triggers it:
#!/usr/bin/perl
use strict; use warnings;
use DBI;
my $dbh = DBI->connect("dbi:Cassandra::host=127.0.0.1;compression=lz4;consistency=quorum",
undef, undef, { RaiseError => 1 });
my $keyspace= "cassandra_tests";
# Start fresh
$dbh->do("drop keyspace if exists $keyspace");
$dbh->do("create keyspace $keyspace with replication={'class':
'SimpleStrategy', 'replication_factor': 5}");
$dbh->do("create table $keyspace.login (
username text,
address text,
end timestamp,
changed timeuuid static,
PRIMARY KEY ( username, address )
)"
);
$dbh->disconnect;
sleep(5); # let the change propagate
my $dbh2 = DBI->connect("dbi:Cassandra::host=127.0.0.1;compression=lz4;consistency=quorum",
undef, undef, { RaiseError => 0 });
my $sth = $dbh2->prepare("BEGIN BATCH
INSERT INTO $keyspace.login (username, changed)
VALUES (?, now())
IF NOT EXISTS
UPDATE $keyspace.login
SET end='2015-09-15'
WHERE username=? AND address='1.1.1.1'
APPLY BATCH;",
);
$sth->execute( "1-alice-1", "1-alice-1" );
$dbh2->disconnect;
Thank you,
Vytas Dauksa