Login   Register  
PHP Classes
elePHPant
Icontem

Multiple partition transaction and Exception

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us

      Ultimate MySQL  >  All threads  >  Multiple partition transaction and Exception  >  (Un) Subscribe thread alerts  
Subject:Multiple partition transaction and Exception
Summary:Transaction Already Exist
Messages:1
Author:restroika
Date:2013-06-04 06:46:53
 

  1. Multiple partition transaction and Exception   Reply   Report abuse  
Picture of restroika
restroika
2013-06-04 06:46:53
As Subject, if my script like this
(1)
try{
$db->TransactionBegin();
$db->Query("...some delete query...");
$db->UpdateRows($some_table,$update_v,$where_v);
$db->InsertRow($some_table,$values);
$db->TransactionEnd();
}catch(Exception $x){
$db->TransactionRoolBack();
$db->Kill($x.getMessage());
}

(2)
try{
$db->TransactionBegin();
$db->UpdateRows($some_table,$update_v,$where_v);
$db->TransactionEnd();
}catch(Exception $x){
$db->TransactionRoolBack();
$db->Kill($x.getMessage());
}

(3)
try{
$db->TransactionBegin();
$db->InsertRow($some_table,$values);
$db->TransactionEnd();
}catch(Exception $x){
$db->TransactionRoolBack();
$db->Kill($x.getMessage());
}

I use the above script to execute the transaction. But what happens when the script is first executed there appears a message like summary ..
But if the three above TransactionBegin Script and TransactionEnd I throw the query will run normally.
I question whether this can be considered a bug? or the structure of my code is wrong?
Thanks in advanted.
Regards. Bika