Author: lektran
Date: Tue Mar 15 09:08:28 2011
New Revision: 1081689
URL:
http://svn.apache.org/viewvc?rev=1081689&view=revLog:
Added check for presence of the max-idle attribute before attempting to parse its value
Modified:
ofbiz/trunk/framework/entity/src/org/ofbiz/entity/connection/DBCPConnectionFactory.java
Modified: ofbiz/trunk/framework/entity/src/org/ofbiz/entity/connection/DBCPConnectionFactory.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/framework/entity/src/org/ofbiz/entity/connection/DBCPConnectionFactory.java?rev=1081689&r1=1081688&r2=1081689&view=diff==============================================================================
--- ofbiz/trunk/framework/entity/src/org/ofbiz/entity/connection/DBCPConnectionFactory.java (original)
+++ ofbiz/trunk/framework/entity/src/org/ofbiz/entity/connection/DBCPConnectionFactory.java Tue Mar 15 09:08:28 2011
@@ -92,12 +92,14 @@ public class DBCPConnectionFactory imple
}
// idle-maxsize, default to half of pool-maxsize
int maxIdle = maxSize / 2;
- try {
- maxIdle = Integer.parseInt(jdbcElement.getAttribute("idle-maxsize"));
- } catch (NumberFormatException nfe) {
- Debug.logError("Problems with pool settings [idle-maxsize=" + jdbcElement.getAttribute("idle-maxsize") + "]; the values MUST be numbers, using calculated default of" + (maxIdle > minSize ? maxIdle : minSize) + ".", module);
- } catch (Exception e) {
- Debug.logError("Problems with pool settings [idle-maxsize], using calculated default of" + (maxIdle > minSize ? maxIdle : minSize) + ".", module);
+ if (jdbcElement.hasAttribute("idle-maxsize")) {
+ try {
+ maxIdle = Integer.parseInt(jdbcElement.getAttribute("idle-maxsize"));
+ } catch (NumberFormatException nfe) {
+ Debug.logError("Problems with pool settings [idle-maxsize=" + jdbcElement.getAttribute("idle-maxsize") + "]; the values MUST be numbers, using calculated default of" + (maxIdle > minSize ? maxIdle : minSize) + ".", module);
+ } catch (Exception e) {
+ Debug.logError("Problems with pool settings [idle-maxsize], using calculated default of" + (maxIdle > minSize ? maxIdle : minSize) + ".", module);
+ }
}
// Don't allow a maxIdle of less than pool-minsize
maxIdle = maxIdle > minSize ? maxIdle : minSize;