Hi Dakota,
Session-scoped variables get set for the duration of the connection, with two exceptions: COM_CHANGE_USER and COM_RESET_CONNECTION are two protocol commands which trigger session variables to be dropped. These are sometimes used by connection pool libraries to ensure a "clean" session state between application check-outs of the Connection object.
Besides that, session-scoped variables are tied to the *physical* connection, which can be replaced inside a logical Connection object for several reasons:
* Failure handled by autoReconnect=true
* Load-balancing, replication or shard-aware deployments
http://mysqlblog.fivefarmers.com/2010/07/05/do-you-really-want-autoreconnect-to-silently-reconnect/
I'd look for one of two things happening:
1. The session variable is being explicitly set by some unknown code elsewhere, overwriting the code you know about (enable and check MySQL general query log to evaluate).
2. The connection state is being modified underneath your logical Connection.
Hope that helps!
--
Todd Farmer
MySQL @ Oracle
http://www.oracle.com/mysql/