Matt Sergeant wrote:
On 22 Jul 2005, at 12:30, Dean Arnold wrote:

Hoping someone can point me at a DBD thats known
to be non-thread-friendly (ie, hasn't implemented
the clone() methods). However, its underlying
client libs and XS subs (if any) do need to be
thread-capable (ie, no writing to process-global
variables wo/ locking).

I'm trying to test out a theory that DBIx::Threaded
will make non-thread-friendly DBD's
not only friendly, but thread-safe.


DBD::SQLite.



I'm running into an issue while trying to test w/ DBIx::Threaded;
there seems to be some interdependency between selectrow_arrayref
and selectall_arrayref using the prepared stmt form.

(I'm on WinXP, AS 5.8.3, DBI 1.48, DBD::SQLite 1.09)

Here's a test script (using regular DBI, *not* DBIx::Threaded)

use DBI;

my $dbh = DBI->connect('dbi:SQLite:dbname=dbix_threaded',
        undef, undef,
        {PrintError => 1, PrintWarn => 1}) or die $DBI::errstr;

$sth = $dbh->prepare(
'select current_timestamp, current_time, current_date')
|| die $dbh->errstr;

$row = $dbh->selectall_arrayref($sth);
die $dbh->errstr
unless (defined($row) && (scalar @$row == 1));
print join(', ', @{$row->[0]}), "\n";

$row = $dbh->selectrow_arrayref($sth);
die $dbh->errstr unless $row;
print join(', ', @$row), "\n";

_END_

The 2nd selectxxx_arrayref($sth) always returns undef,
but $dbh->errstr only reports

not an error(21) at dbdimp.c line 415

If I switch the order of the selectxxx's, I
still get the same error on the 2nd select.

Any ideas ? I'd like to include the SQLite tests in
DBIx::Threaded (this appears to be the only outstanding
issue w/ SQLite).

Regards,
Dean Arnold
Presicient Corp.

Reply via email to