pike.git
/
lib
/
modules
/
Sql.pmod
/
pgsql.pike
version
»
Context lines:
10
20
40
80
file
none
3
pike.git/lib/modules/Sql.pmod/pgsql.pike:1214:
} } //! Closes the connection to the database, any running queries are //! terminated instantly. //! //! @note //! This function is PostgreSQL-specific, and thus it is not available //! through the generic SQL-interface. /*semi*/final void close() {
+
throwdelayederror(this);
Thread.MutexKey lock; if (qportals && qportals->size()) catch(cancelquery()); if (unnamedstatement) termlock = unnamedstatement->lock(1); c->close(); if (unnamedstatement) lock = unnamedstatement->lock(1); destruct(c); lock = 0; destruct(waitforauthready); } protected void destroy() {
-
catch(close());
+
string errstring;
+
mixed err =
catch(close());
.pgsql_util.unregister_backend();
-
+
/*
+
* Flush out any asynchronously reported errors to stderr; because we are
+
* inside a destructor, throwing an error will not work anymore.
+
*/
+
if (err || (err = catch(errstring = error(1))))
+
werror(describe_backtrace(err));
+
else if (sizeof(errstring))
+
werror(errstring);
} final void _connectfail(void|mixed err) { PD("Connect failed %O reconnectdelay %d\n",err,reconnectdelay); if(!err || reconnectdelay) { int tdelay; switch(tdelay=reconnectdelay) { case 0: reconnectdelay=RECONNECTDELAY; break;