Commit 994bf861 authored by Daniel Henninger's avatar Daniel Henninger Committed by dhenninger

Ported changes from 3.5.0 branch.


git-svn-id: http://svn.igniterealtime.org/svn/repos/openfire/trunk@10097 b35dd754-fafc-0310-a699-88a17e54d16e
parent 70c98c1d
...@@ -81,7 +81,7 @@ public class DbConnectionManager { ...@@ -81,7 +81,7 @@ public class DbConnectionManager {
setConnectionProvider((ConnectionProvider)conClass.newInstance()); setConnectionProvider((ConnectionProvider)conClass.newInstance());
} }
catch (Exception e) { catch (Exception e) {
Log.error("Warning: failed to create the " + Log.warn("Failed to create the " +
"connection provider specified by connection" + "connection provider specified by connection" +
"Provider.className. Using the default pool.", e); "Provider.className. Using the default pool.", e);
setConnectionProvider(new DefaultConnectionProvider()); setConnectionProvider(new DefaultConnectionProvider());
...@@ -93,12 +93,32 @@ public class DbConnectionManager { ...@@ -93,12 +93,32 @@ public class DbConnectionManager {
} }
} }
} }
Connection con = connectionProvider.getConnection();
// TODO: May want to make these settings configurable
Integer retryCnt = 0;
Integer retryMax = 10;
Integer retryWait = 250; // milliseconds
Connection con;
do {
retryCnt++;
con = connectionProvider.getConnection();
if (con != null) {
// Got one, lets hand it off.
break;
}
try {
Thread.sleep(retryWait);
}
catch (Exception e) {
// Ignored
}
} while (retryCnt <= retryMax);
if (con == null) { if (con == null) {
Log.error("WARNING: ConnectionManager.getConnection() " + Log.warn("ConnectionManager.getConnection() " +
"failed to obtain a connection."); "failed to obtain a connection.");
} }
// See if profiling is enabled. If yes, wrap the connection with a // See if profiling is enabled. If yes, wrap the connection with a
// profiled connection. // profiled connection.
if (profilingEnabled) { if (profilingEnabled) {
......
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
String defaultSearchFilter; String defaultSearchFilter;
// First check if the http session holds data from a previous post of this page // First check if the http session holds data from a previous post of this page
if (session.getAttribute("ldapUserSettings") != null && session.getAttribute("ldapVCardBean") != null) { if (session.getAttribute("ldapUserSettings") != null && session.getAttribute("ldapVCardBean") != null) {
@SuppressWarnings("unchecked")
Map<String, String> userSettings = (Map<String, String>) session.getAttribute("ldapUserSettings"); Map<String, String> userSettings = (Map<String, String>) session.getAttribute("ldapUserSettings");
defaultUsernameField = userSettings.get("ldap.usernameField"); defaultUsernameField = userSettings.get("ldap.usernameField");
defaultSearchFields = userSettings.get("ldap.searchFields"); defaultSearchFields = userSettings.get("ldap.searchFields");
...@@ -94,6 +95,7 @@ ...@@ -94,6 +95,7 @@
vcardBean.setAvatarStoredInDB(false); vcardBean.setAvatarStoredInDB(false);
} }
// Store the vcard db setting for later saving. // Store the vcard db setting for later saving.
@SuppressWarnings("unchecked")
Map<String,String> xmppSettings = (Map<String,String>)session.getAttribute("xmppSettings"); Map<String,String> xmppSettings = (Map<String,String>)session.getAttribute("xmppSettings");
if (xmppSettings != null) { if (xmppSettings != null) {
xmppSettings.put("ldap.override.avatar", vcardBean.getAvatarStoredInDB().toString()); xmppSettings.put("ldap.override.avatar", vcardBean.getAvatarStoredInDB().toString());
...@@ -160,7 +162,7 @@ ...@@ -160,7 +162,7 @@
sb.append("&userIndex=").append(request.getParameter("userIndex")); sb.append("&userIndex=").append(request.getParameter("userIndex"));
} }
%> %>
<a href="<%= sb.toString()%>" id="lbmessage" title="<fmt:message key="global.test" />" style="display:none;"/> <a href="<%= sb.toString()%>" id="lbmessage" title="<fmt:message key="global.test" />" style="display:none;"></a>
<script type="text/javascript"> <script type="text/javascript">
function loadMsg() { function loadMsg() {
var lb = new lightbox(document.getElementById('lbmessage')); var lb = new lightbox(document.getElementById('lbmessage'));
...@@ -200,7 +202,7 @@ ...@@ -200,7 +202,7 @@
<% } %> <% } %>
<form action="<%= currentPage%>" method="post"> <form action="<%= currentPage%>" method="post">
<input type="hidden" name="serverType" value="<%=serverType%>"> <input type="hidden" name="serverType" value="<%=serverType%>"/>
<!-- BEGIN jive-contentBox_bluebox --> <!-- BEGIN jive-contentBox_bluebox -->
<div class="jive-contentBox_bluebox"> <div class="jive-contentBox_bluebox">
......
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