http://www.perlmonks.org?node_id=11158398


in reply to Does each DBI 'do' start a new transaction?

If you look at the DBI documentation, you'll see that the do method returns a success or failure status. In the code you've posted, you're throwing away that information. Developer Tip: Don't Do That.

Assume that any operation can fail, at any time. As soon as there's a failure, you have to report that error.

Alex / talexb / Toronto

Thanks PJ. We owe you so much. Groklaw -- RIP -- 2003 to 2013.

Replies are listed 'Best First'.
Re^2: Does each DBI 'do' start a new transaction?
by ikegami (Patriarch) on Mar 19, 2024 at 19:36 UTC

    They're using an error handler ($dbh->{HandleError}=\&handle_error;)

      I missed that. :( Now, what happens when there's a DBI error inside the error handler? Does it call itself until it hits the 'deep recursion' error? That would be a good place to locally delete the error handler and do something different with that error.

      Alex / talexb / Toronto

      Thanks PJ. We owe you so much. Groklaw -- RIP -- 2003 to 2013.