MySQL Forums
Forum List  »  General

Re: Random data loss, less than 0.1% of the time - how to prevent it
Posted by: Rick James
Date: March 24, 2014 10:56PM

I am unfamiliar with Exception::Class. DBI does not abort, so eval{} would not 'catch' it, correct

Suggest you write a small test case to validate the try-catch code. One simple suggestion is
CREATE TABLE test (x INT PRIMARY KEY);
INSERT INTO test VALUE (1);
INSERT INTO test VALUE (1); -- should get "Duplicate key" error.

Wrap each INSERT in DBI and Exception (or eval or try), and see if the error is 'caught'.

Options: ReplyQuote


Subject
Written By
Posted
Re: Random data loss, less than 0.1% of the time - how to prevent it
March 24, 2014 10:56PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.