I have a project that is, intermittently, changing the time_zone value from a user defined value, to SYSTEM, and I am trying to determine if MySQL considers 'the current session' (MySQL TimeZone) the connection, or, the workstation IP that the connection is coming from.
Basically, if it's not per connection, then something else is connecting to MySQL and changing the time_zone value back to SYSTEM, which is then having an impact on my already connected software.
If it is per connection, then I am back to trying to figure out WHERE the time_zone is being reset.
For further info, my project is written in Delphi XE3, using the MyDAC components for DB connections. When the project loads, I read a connection file and, if there is a time_zone string set, I execute the 'Set Time_zone' query. The connection stays active through-out the applications run lifetime and is global to the application (i.e. I don't create/connect other connections from this application to the DB).
Thanks for your assistance!
A MySQL session corresponds to a connection.
The MySQL server automatically disconnects idle sessions after a timeout, based on the value of the system variable wait_timeout
, which defaults to 28800 seconds (8 hours). It sounds like Delphi is automatically reconnecting your session, but per-session settings will be lost when this happens.
You should change your application so that it sends the timezone setting if it has been idle for a long period of time. You could also increase the wait_timeout
(the maximum value is 2147483, 24.85 days).