• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Commit and rollback with CI

#1
[eluser]Omarion[/eluser]
Hi all!

Someone know how to use Commit and Roldback with CI?
I think that we should to use Mysqli.

Thanks

#2
[eluser]Relexx[/eluser]
http://ellislab.com/codeigniter/user-gui...tions.html

#3
[eluser]Omarion[/eluser]
Relexx, thank you very muth for your answer!

I read the CI Guide, but I have a question.

Is it possible to use CI transaction only with Mysql instead of Mysqli ?

And about auto-commit, should I set it off manually?

Thanks!

#4
[eluser]Relexx[/eluser]
I believe that CI uses PDO not mysql or mysqli, assuming that you are using Database class, so my guess you would need to use mysql or mysqli transaction interface instead if you are explicity using these.

Re: Auto Commit. The whole purpose of a transaction encapsulation is the ability to roll back a number of sql statements without having to undo an already committed transaction. Auto commit is ok when not performing sql in an encapsulated transaction. I would stick with the defaults. If you want to execute multiple inserts, updates, deletes, and if one fails rollback, encapsulate the statements with trans_start trans_complete.


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


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