Commit daa618d8 authored by Gaston Dombiak's avatar Gaston Dombiak Committed by gato

Try to create a new connection pool if none was found and a new connection was requested. JM-1028

git-svn-id: http://svn.igniterealtime.org/svn/repos/openfire/trunk@9640 b35dd754-fafc-0310-a699-88a17e54d16e
parent d3d0d8e5
...@@ -65,11 +65,22 @@ public class DefaultConnectionProvider implements ConnectionProvider { ...@@ -65,11 +65,22 @@ public class DefaultConnectionProvider implements ConnectionProvider {
synchronized (initLock) { synchronized (initLock) {
// if still null, something has gone wrong // if still null, something has gone wrong
if (connectionPool == null) { if (connectionPool == null) {
Log.error("Warning: DbConnectionDefaultPool.getConnection() was " + Log.error("DbConnectionDefaultPool.getConnection() was " +
"called before the internal pool has been initialized."); "called before the internal pool has been initialized or " +
"there was a problem connecting to the database.");
// Attempt to connect again if setup was already done
if ("true".equals(JiveGlobals.getXMLProperty("setup"))) {
this.restart();
if (connectionPool == null) {
Log.error("Recovery logic failed to reconnect to the database.");
return null; return null;
} }
} }
else {
return null;
}
}
}
} }
return connectionPool.getConnection(); return connectionPool.getConnection();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment