Default: DISCARD ALL
+server_reset_query_always
+-------------------------
+
+Whether `server_reset_query`_ should be run in all pooling modes. When this
+setting is off (default), the `server_reset_query`_ will be run only in pools
+that are in sessions-pooling mode. Connections in transaction-pooling mode
+should not have any need for reset query.
+
+Default: 0
+
server_check_delay
------------------
;
server_reset_query = DISCARD ALL
+
+; Whether server_reset_query should run in all pooling modes.
+; If it is off, server_reset_query is used only for session-pooling.
+;server_reset_query_always = 0
+
;
; Comma-separated list of parameters to ignore when given
; in startup packet. Newer JDBC versions require the
extern usec_t cf_server_lifetime;
extern usec_t cf_server_idle_timeout;
extern char * cf_server_reset_query;
+extern int cf_server_reset_query_always;
extern char * cf_server_check_query;
extern usec_t cf_server_check_delay;
extern usec_t cf_server_connect_timeout;
int cf_max_user_connections;
char *cf_server_reset_query;
+int cf_server_reset_query_always;
char *cf_server_check_query;
usec_t cf_server_check_delay;
int cf_server_round_robin;
CF_ABS("autodb_idle_timeout", CF_TIME_USEC, cf_autodb_idle_timeout, 0, "3600"),
CF_ABS("server_reset_query", CF_STR, cf_server_reset_query, 0, "DISCARD ALL"),
+CF_ABS("server_reset_query_always", CF_INT, cf_server_reset_query_always, 0, "0");
CF_ABS("server_check_query", CF_STR, cf_server_check_query, 0, "select 1"),
CF_ABS("server_check_delay", CF_TIME_USEC, cf_server_check_delay, 0, "30"),
CF_ABS("query_timeout", CF_TIME_USEC, cf_query_timeout, 0, "0"),
server->link->link = NULL;
server->link = NULL;
- if (*cf_server_reset_query) {
+ if (*cf_server_reset_query && (cf_server_reset_query_always ||
+ pool_pool_mode(pool) == POOL_SESSION))
+ {
/* notify reset is required */
newstate = SV_TESTED;
} else if (cf_server_check_delay == 0 && *cf_server_check_query) {