Branch: Tag:

2015-12-23

2015-12-23 16:20:14 by Stephen R. van den Berg <srb@cuci.nl>

pgsql: Tear down result objects if the connection breaks.

1242:    Thread.MutexKey lock=_shortmux->lock();    if(waitforauthready) {    lock=0; -  return 0; // Connect still in progress in other thread +  return 1; // Connect still in progress in other thread    }    waitforauthready=Thread.Condition();    lock=0;
1261:    PD("Flushing old cache\n");    foreach(_prepareds;;mapping tp)    m_delete(tp,"preparedname"); -  if(!_options.reconnect) +  if(!_options.reconnect) { +  string msg=sprintf("Lost connection to database %s:%d",_host,_port); +  if(force) { +  lastmessage+=({msg});    return 0; -  +  } else +  ERROR(msg+"\n");    } -  +  }    PD("Actually start to connect\n");    qportals=Thread.Queue();    _readyforcommit=Thread.Condition();