[thelist] Query failed during a credit card transaction

Hassan Schroeder hassan.schroeder at gmail.com
Wed Apr 16 13:34:51 CDT 2008

On Wed, Apr 16, 2008 at 10:48 AM, Nan Harbison <nan at nanharbison.com> wrote:

>  So someone tried to sign up this morning, got into the database with client
>  information and into the credit card transaction table - but when the table
>  was being updated with the transaction ID, he got this error:
>  Query failed: Lost connection to MySQL server during query.

FWIW, I only do a single insert, and that's with the result of the authorization
request, so there's no chance of partial data being stored .

I'd strongly suggest you put a try/catch block around that whole
transaction, so
you can provide a friendlier error message, and possibly a retry option.

>  I actually don't know if the credit card transaction also failed or not

? My client (and I) get an immediate emailed notification from authorize.net
when a transaction goes through; perhaps that's a configurable option. It's
certainly nice to see them in the inbox :-)

>  First question - do I need to set up email to myself when DB errors happen?

Main thing is to look at anywhere a critical DB operation takes place
and see if you can insulate the user experience from failures, while
capturing as much diagnostic information as possible. Otherwise, just
getting an email after the fact doesn't do much good :-)

>  Second question, any guesses as to why this happened? Was it on the internet
>  connection of the person signing up or on the part of the web host

Sounds like a hosting problem -- is this a dedicated server, VPS,

>  And other suggestions? This is a little scary to think about, losing clients
>  who can't complete the transaction.

Wherever you can catch an error that will interrupt a transaction, retry
automatically if possible, and if not offer to restart the process with as
much saved info as available, or provide a "sorry this isn't working,
please call us at nnn-nnn-nnnn for immediate personal service" type
of message.

HTH, and good luck!
Hassan Schroeder ------------------------ hassan.schroeder at gmail.com

More information about the thelist mailing list