RE: [dbi] Execute marks end of transaction?
- From: martin.evans@xxxxxxxxxxxx (Martin J. Evans)
- Date: Tue, 11 Jul 2006 11:37:39 +0100 (BST)
On 11-Jul-2006 Jimmy Li wrote:
Can I end a transaction as soon as I call execute()?
Yes
or do I have to wait
until I finish fetching all the rows?
No
For example, I have:
------------------------------------------------------------------------------
------------------------------------------------------------------------------
----------
$dbh->do("start transaction");
my $groups_query = $dbh->prepare(qq{select id, name from staff_grp});
$groups_query->execute;
# place1
$groups_query->finish if (want_to_stop_here);
while (my @one_group = $groups_query->fetchrow_array)
{
print @one_group;
}
#place 2
------------------------------------------------------------------------------
------------------------------------------------------------------------------
----------
Can I end the transaction in #place1 or do I have to wait until #place2?
See above.
Martin
--
Martin J. Evans
Easysoft Ltd, UK
http://www.easysoft.com
.
- Follow-Ups:
- Re: [dbi] Execute marks end of transaction?
- From: Jonathan Leffler
- Re: [dbi] Execute marks end of transaction?
- References:
- Execute marks end of transaction?
- From: Jimmy Li
- Execute marks end of transaction?
- Prev by Date: Execute marks end of transaction?
- Next by Date: RE: memory leak in DBI XS bootstrap code
- Previous by thread: Execute marks end of transaction?
- Next by thread: Re: [dbi] Execute marks end of transaction?
- Index(es):
Relevant Pages
|
|