[Devel] CVS commitlog: sip-server/modules/mysql my_con.c

Dan Pascu dan at ag-projects.com
Mon Jan 16 19:54:58 CET 2006


On Monday 16 January 2006 15:51, Bogdan-Andrei Iancu wrote:
>   - reconnect option is explicitly forced after mysql_real_connect()

You should be careful with automatic reconnection because it could 
silently corrupt data (after reconnection you potentially lose table 
locks, user variables, session variables, temporary tables and mess up 
transactions that were started but not finished).

Now I'm pretty sure that openser doesn't use transactions or temporary 
tables, so those are not not an issue, but I'm not sure about locks or 
connection variables.

Reconnecting is safe only if these features are not used. Somebody with 
more knowledge about the mysql module should check if these things are 
not in use, before we can declare reconnecting safe. Also a comment about 
these issues should be placed near the reconnect flag for future 
reference about possible issues to keep in mind when extending the mysql 
code.

-- 
Dan



More information about the Devel mailing list