What happens with Apache::DBI? -----Original Message----- From: David Nicol [mailto:davidni...@gmail.com] Sent: Tuesday, July 12, 2011 12:00 PM To: ZhangJun Cc: dbi-users@perl.org Subject: Re: is it possible to use two sth from same dbh at the same time ?
when it isn't possible, you can create two database handles, and they can have different attributes. my $dbhA = DBI->connect(); my $dbhB = DBI->connect(); my $sth1 = $dbhA->prepare( $sql_a ); my $sth2 = $dbhB->prepare( $sql_b ); $sth1->execute; $dbhB->begin_work; END { $dbhB->commit} while ( my ($id) = $sth1->fetchrow_array ) { state $counter = 1; $sth2->execute( $id ); $counter++ % 2000 or $dbhB->commit; };