Yes. You must start and end a transaction with the same mysql connection. MySQL connections are automatically closed once the page has finished executing. A redirect stops the current page execution.
Cheers, Adam ----- Original Message ----- From: "Mateo San Román" <[email protected]> To: "CakePHP" <[email protected]> Sent: Monday, June 22, 2009 2:49 PM Subject: transactions + redirect doesn't work! > > Hello > > I have this code: > > > function A () { > $this->query('BEGIN TRANSACTION A'); > xxx > xxx > $this->redirect('/controller/B); > } > > function B () { > xxx > xxx > $this->query('COMMIT TRANSACTION A'); > } > > doesn't work because there is a missing "BEGIN TRANSACTION" > > However, if I use instead > > $this->query('BEGIN TRANSACTION A'); > xxx > xxx > $this->B(); > } > > It works somehow. Any ideas about this? Does redirect automatically > shuts down existing transaction? > > Thanks a lot > > > > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~----------~----~----~----~------~----~------~--~---
