Re: how to use transactions in cakephp

2011-01-14 Thread Ryan Schmidt
On Jan 12, 2011, at 04:58, Larry E. Masters wrote: I just noticed this thread. You might want to look at a video someone uploaded to http://tv.cakephp.org recently showing how to use transactions with CakePHP http://tv.cakephp.org/video/guille1983/2011/01/10/database_transactions

Re: how to use transactions in cakephp

2011-01-14 Thread Larry E. Masters
, Ryan Schmidt google-2...@ryandesign.com wrote: On Jan 12, 2011, at 04:58, Larry E. Masters wrote: I just noticed this thread. You might want to look at a video someone uploaded to http://tv.cakephp.org recently showing how to use transactions with CakePHP http://tv.cakephp.org/video

Re: how to use transactions in cakephp

2011-01-13 Thread huoxito
yeah, i'll take a look at that .., thanks Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to

Re: how to use transactions in cakephp

2011-01-12 Thread Larry E. Masters
I just noticed this thread. You might want to look at a video someone uploaded to http://tv.cakephp.org recently showing how to use transactions with CakePHP http://tv.cakephp.org/video/guille1983/2011/01/10/database_transactions -- Larry E. Masters On Tue, Jan 11, 2011 at 11:44 PM, huoxito

Re: how to use transactions in cakephp

2011-01-12 Thread Zeu5
Thank you for the update PhpNut :) On Jan 12, 6:58 pm, Larry E. Masters php...@gmail.com wrote: I just noticed this thread. You might want to look at a video someone uploaded tohttp://tv.cakephp.orgrecently showing how to use transactions with CakePHP http://tv.cakephp.org/video/guille1983

Re: how to use transactions in cakephp

2011-01-11 Thread huoxito
great topic, just helped me alot here, thanks! so good cake got this group! Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this

Re: how to use transactions in cakephp

2010-12-24 Thread Zeu5
Hi all, it did not work. I have tried This is for a Merchant Model; $datasource = $this-getDataSource(); $datasource-begin($this); $result = $this-saveAll($data); if (!$result) { $datasource-rollback($this); return false; } /** * do something to form a $domainData array **/ $result =

Re: how to use transactions in cakephp

2010-12-24 Thread Amit Badkas
Hi, I didn't know that you need to use saveAll() inside transaction. By default, saveAll() starts new transaction. So change your saveAll() call from $result = $this-saveAll($data); to $result = $this-saveAll($data, array('atomic' = false)); Hope this helps. Amit Badkas PHP Applications for

Re: how to use transactions in cakephp

2010-12-24 Thread Zeu5
Thanks for the tip Amit. I shall go try that. Any idea why i cannot subscribe to this particular thread via my gmail? On Dec 24, 4:31 pm, Amit Badkas amit.sanis...@gmail.com wrote: Hi, I didn't know that you need to use saveAll() inside transaction. By default, saveAll() starts new

Re: how to use transactions in cakephp

2010-12-24 Thread Zeu5
Hi Amit, it worked. Thank you very much. Saw your website. Interesting. Apparently i had previously added you to my watchlist for providers who appear to be experienced in cakephp. Perhaps next time when i seek major help in cakephp, i will consider your company more. :) Have a good weekend.

how to use transactions in cakephp

2010-12-23 Thread Zeu5
hi there, i have a 7 model transaction that needs to be rolled back whenever 1 of the tables do not commit properly. i found this but i am not sure how it works. http://book.cakephp.org/view/1633/Transactions I am vaguely familiar with MySQL transaction but prefer to follow cake way of doing

Re: how to use transactions in cakephp

2010-12-23 Thread Jon Bennett
i have a 7 model transaction that needs to be rolled back whenever 1 of the tables do not commit properly. i found this but i am not sure how it works. http://book.cakephp.org/view/1633/Transactions I am vaguely familiar with MySQL transaction but prefer to follow cake way of doing

Re: how to use transactions in cakephp

2010-12-23 Thread Zeu5
Hi Jon Use innodb and connect your keys/tables correctly. Use saveAll not save and it will wrap all the SQL into a single transaction. Are you suggesting an alternative to http://book.cakephp.org/view/1633/Transactions ? Unfortunately the 7 models are not interrelated to each other, some are

Re: how to use transactions in cakephp

2010-12-23 Thread Jon Bennett
Unfortunately the 7 models are not interrelated to each other, some are of course related. So i am not sure if saveAll allows that non interrelated models. I've only used transactions in cake to save related data, though I believe once a transaction has been triggered, it will wrap any

Re: how to use transactions in cakephp

2010-12-23 Thread Zeu5
Alright thanks! On Dec 23, 8:55 pm, Jon Bennett jmbenn...@gmail.com wrote: Unfortunately the 7 models are not interrelated to each other, some are of course related. So i am not sure if saveAll allows that non interrelated models. I've only used transactions in cake to save related data,

Re: how to use transactions in cakephp

2010-12-23 Thread Amit Badkas
Hi, I would use something like following in one of the models to save data for non-related InnoDB tables $db = ConnectionManager::getDataSource($this-useDbConfig); $db-begin($this); save code here $db-commit($this); Hope this helps. Amit Badkas PHP Applications for E-Biz: