1
0
Fork 0

*** empty log message ***

This commit is contained in:
bagyenda 2009-03-01 06:34:12 +00:00
parent a721364402
commit abb7b6d2d1
2 changed files with 18 additions and 5 deletions

View File

@ -1,3 +1,5 @@
2009-03-01 P. A. Bagyenda <bagyenda@dsmagic.com>
* pgsql-queue module fix: Connection pool should return only valid (active) connections
2009-02-25 P. A. Bagyenda <bagyenda@dsmagic.com>
* Added ChargedParty MM7/SOAP param to mmsbox
* Fixed: Improper setting of log level

View File

@ -159,12 +159,20 @@ static PGconn *get_conn_real(const char *function, const char *file, const int l
/* debug("pg_cp",0, "pg_get_conn> %s:%d, %s => %d", file, line, function, (int)c); */
if (c) { /* might fail if we are shutting down. */
if (c && PQstatus(c) == CONNECTION_OK) { /* might fail if we are shutting down. */
r = PQexec(c, "BEGIN"); /* start a transaction. */
PQclear(r);
} else
mms_error(0, "pgsql_queue", NULL, "pg_get_conn: Failed to get a free connection from connection pool! Consider increasing pool size (currently %d)?",
pool_size);
} else {
mms_error(0, "pgsql_queue", NULL,
"pg_get_conn: Failed to get a free connection [%s] from connection pool! "
" Consider increasing pool size (currently %d)?",
c ? "NOT CONNECTED" : "TIMEOUT",
pool_size);
if (c) {
PQfinish(c);
c = NULL;
}
}
return c;
}
@ -182,7 +190,10 @@ static void return_conn_real(PGconn *c, const char *function, const char *file,
else
r = PQexec(c, "COMMIT");
PQclear(r);
gwlist_produce(free_conns,c);
if (PQstatus(c) == CONNECTION_OK)
gwlist_produce(free_conns,c);
else
PQfinish(c);
}