Hello sqlite-users

I am new with SQLite and need your advice.

I'm using DBD-SQLite 0.28 on WindowsXP SP1 ActiveState Perl 5.8.0 and
use threads (because this is a GUI-app).

The get following error :
thread failed to start: DBD::SQLite::db do failed: handle 2 is owned by thread 2
240e4 not current thread 19c8f7c (handles can't be shared between threads and your
driver may need a CLONE method added) at E:\sqlite\1\threads.pl line 12.

the CLONE is referring to this code in SQLite.pm :
...
sub CLONE {
    undef $drh;
}
...

there are no error if I replace lines:

my $thr = threads->new(\&Insert);   # create thread
my @Return = $thr->join;            # waiting for results

by this one:

Insert();    # no error, of course

the search in google for similar errors return to me:
http://nntp.x.perl.org/group/perl.ithreads/707
http://www.mail-archive.com/[EMAIL PROTECTED]/msg18515.html
http://gborg.postgresql.org/pipermail/dbdpg-general/2003-June/000171.html
but I don't found any solution.

Could anybody bring some light in the darkness???


this is my minimal code that lead to error:

### begin  #############

use threads;
use strict;
use DBI;
my $dbh = DBI->connect("dbi:SQLite:dbname=ex1.sql","","",
                        { RaiseError => 1, AutoCommit => 1});
                        
my $thr = threads->new(\&Insert);     # create thread
my @Return = $thr->join;              # waiting for results

sub Insert{
  $dbh->do("INSERT INTO tab3 VALUES('a','b','c','d')"); # for short
};

### end  ##############

-- 
Best regards,
Pavel             mailto:[EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to