in reply to Re^2: Threads and multiple DBI connections
in thread Threads and multiple DBI connections
The problem is that $dbh->dbix_threaded_start_prepare won't return the statement object handle, so $sth ends up being empty.
I agree that the documentation is very confusing.
The $dbh->dbix_threaded_start_* calls don't return handles, they return immediately with IDs.
You then have call $rc = $h->dbix_threaded_wait( $id ); to wait for the thing you started to complete.
So, to asynchonously prepare a statement, you'd do (something like; untested):
my $prepID = $dbh->dbix_threaded_start_prepare( $sql, ... ); ... ## you can do other stuff here ... my $sth = $dbh->dbix_threaded_wait($id);
But you don't need to use the asynchronous calls for everything. You could just use the normal dbi calls for some things.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Threads and multiple DBI connections
by clone4 (Sexton) on Nov 01, 2010 at 20:22 UTC | |
by BrowserUk (Patriarch) on Nov 01, 2010 at 22:02 UTC | |
by Anonymous Monk on Nov 02, 2010 at 11:17 UTC |