Geert Janssens
Thu, 04 Feb 2010 07:07:08 -0800
On Thursday 4 February 2010, Tom Van Braeckel wrote: > Hi guys, > > Here's another patch - my first *code* patch to GnuCash ! > > Rationale: When we try to open a database transaction, and the database > reports that the "server has gone away", we try to reconnect before failing > hard. > Hi,
Thanks you for your patch. It looks like a good start, but to my limited knowledge of the sql backend, it seems incomplete. Here are my thoughts on the patch: * you test for an error by comparing with a string. I think it would probably be safer and definitely be more efficient to simply test for the error number returned by dbi_conn_error. It's possible that the error strings returned by MySQL are translated into other languages on other systems, so your string wouldn't always match. * what happens if not only the connection had timed out, but something else changed as well (an administrator changed the login password for example) ? I mean you don't check the results of dbi_connect or the second dbi_conn_queryf. * I also think there may be more useful places to check for a connection timeout, not only at the beginning of transactions. I found several occurences of dbi_conn_query and dbi_conn_queryf some of which could be called passed a timeout. As said in the beginning, I'm not the dbi expert, so maybe my comments are off mark or plain silly. > I've also attached it to the bug report, and taken the liberty to add > myself to the AUTHORS file. > I hope that's customary here, and I apologise if it's not... > I think this is quite ok. I would just like to ask you to put your name in alpabetical order which I think would put you between Richard -Gilligan- Uschold and Matthew Vanecek. > Thanks again for this great software, > Keep submitting patches ! > Tom Van Braeckel > GSM: 0032 (0) 486 63 58 04 > Geert _______________________________________________ gnucash-devel mailing list gnucash-devel@gnucash.org https://lists.gnucash.org/mailman/listinfo/gnucash-devel