Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
App. best practice for mysql remote db
Message
From
12/07/2007 15:13:25
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP
Network:
Windows XP
Database:
MySQL
Miscellaneous
Thread ID:
01239748
Message ID:
01239871
Views:
8
>
>from MySQL help...
>If the mysql client loses connection to the server while sending it a query, it will immediately and automatically try to reconnect once to the server and send the query again. Note that even if it succeeds in reconnecting, as your first connection has ended, all your previous session objects are lost : temporary tables, user and session variables. Therefore, the above behaviour may be dangerous for you, like in this example where the server was shut down and restarted without you knowing it :
>
>see to "4.8.2 mysql, The Command-line Tool"
>
Hi MartinaJ

Well.. I believe the old messagebox with RETRY and CANCEL options sounds fine.. for this..

My users isn't working under something "high-online" stuff.. I'm updating the DB with local vfp table.. I can't see what should could loose under this circunstancies

>
>>>Use AERROR() function to capture ODBC error info.
>>>
>>
>>this is the message got from aerror/mysql... seems that I really need to restart the connection:
>>
>>
>>[MySQL][ODBC 3.51 Driver][mysqld-4.1.12-Max-log]MySQL server has gone away
>>
>>
>>What do you think?
>>
>>>>
>>>>I do have an app. that was created for remote web access of mysql data..
>>>>
>>>>it is an ussual logic by:
>>>>
>>>>1. open the conection to DB
>>>>2. start the update/insert user procedures.. During almost all day long..
>>>>3. Close the conection
>>>>
>>>>All working fine, on developing time.. But, on the production, the app. faces the new variable named 'time'..
>>>>
>>>>It is very common for a given period.. the application starts to return -1 on the insert/update sql's commands...
>>>>
>>>>So, at this time, for me, the logic stuff.. seems to change the logic to start the conection again on every -1 returned...
>>>>
>>>>But, before to go to this (a little) unlogic step.. I'd like to read advices here.. Or (who knows) maybe other options on the connections..
>>>>
>>>>TIA
>>>>
>>>>BTW, this is my actual try:
>>>>
>>>>
>>>>	privStrConexao               = "DRIVER=MySQL ODBC 3.51 Driver;" +;
>>>>		"SERVER="                + this.cServidor_bancodedados + ";" +;
>>>>		"UID=myuser;"             +;
>>>>		"PWD=mypass;"           +;
>>>>		"DATABASE=mydb;"  +;
>>>>		"WSID=" + Lower(Substr(Sys(0), 1, Atc("#", Sys(0))-1)) + ";" +;
>>>>		"Port=3306;OPTION=3;" +;
>>>>		"Trusted_Connection=Yes"
>>>>	privConexao    				 = 0
>>>>	i3             				 = 0
>>>>	If  Type("this.privConexao") = "U"
>>>>		This.AddProperty("privConexao", .F.)
>>>>	Endif
>>>>	This.privConexao			 = Sqlstringconnect(privStrConexao)
>>>>
>>>>
>>>>Claudio
"Now to him who is able to do immeasurably more than all we ask or imagine, according to his power that is at work within us, Ephesians 3:20
Previous
Reply
Map
View

Click here to load this message in the networking platform