Page 1 of 1

Re: Transaction Rollback

Posted: Wed Oct 15, 2014 1:26 am
by requinix
Just do everything like normal: check that queries succeed, grab error information if they don't, that kind of thing. Transactions can help you deal with error cases and race conditions but they don't have much else of an impact on your code design.

Re: Transaction Rollback

Posted: Wed Oct 15, 2014 2:32 am
by requinix
So... do that. I don't see what's preventing you from reporting your own error messages according to however you feel. Maybe you have an example of what you're working with?

Tip: if you mean row numbers like line numbers in your code then use __LINE__.

Re: Transaction Rollback

Posted: Wed Oct 15, 2014 10:09 pm
by requinix
If the query fails, MySQL will not tell you exactly what row caused it to fail. You'll have to figure that out for yourself.

Check your data before you try to do anything. If the data is good then continue, if the data is bad then stop. Since you're the one checking the data you will know exactly why you thought it was bad.