• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Transaction Rollback Performance


I'm getting very poor performance when a transaction "fails".


[Loop through received data and send it to a model that deals with the inserts/updates.]

if ($this->db->trans_status() === FALSE)
     [Return error]

When the transaction finishes without any error it finishes very quickly, but when an error occurs it seems to stall for 3-4 seconds before rolling back.
Is this due to the fact that I call an external model for the database interaction? (The model uses active record)
I've disabled db_debug in the database.php config file as was suggested somewhere else...

Thank you

My suggestions:
Move your transaction commands to the model function.
Try having least number of programming logic in between the start and end transaction commands.. have your data prepared inside your controller (prior to sending it to the model) rather then doing it inside the transaction start/end commands... enabling "profiling" can also provide some useful information about time it takes to execute query etc..

The reason as to why its not implemented in the model is that the model only handles single queries(which works well for everything else except this specific application).
This is part of an XML-RPC server that gets quite a bit of data and then submits it to the DB.
But I think I've gotten rid of the performance glitches now.

Thank you for your suggestions!

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.