mirror of https://github.com/apache/openjpa.git
OPENJPA-2773 set dbcp defaults to align with commons dbcp
Especially the maxIdle=0 was problematic. It effectively disables the whole pooling, which is counter productive.
This commit is contained in:
parent
de316bc018
commit
fa6ce77004
|
@ -188,15 +188,16 @@ extends SimpleDriverDataSource implements Configurable, Closeable {
|
||||||
}
|
}
|
||||||
|
|
||||||
// set some default properties for DBCP
|
// set some default properties for DBCP
|
||||||
|
if (hasKey(dbcpProps, "maxActive") == null) {
|
||||||
|
dbcpProps.setProperty("maxActive", "10");
|
||||||
|
}
|
||||||
if (hasKey(dbcpProps, "maxIdle") == null) {
|
if (hasKey(dbcpProps, "maxIdle") == null) {
|
||||||
dbcpProps.setProperty("maxIdle", "1");
|
// by default we set maxIdle to the same value as maxActive.
|
||||||
|
dbcpProps.setProperty("maxIdle", dbcpProps.getProperty("maxActive"));
|
||||||
}
|
}
|
||||||
if (hasKey(dbcpProps, "minIdle") == null) {
|
if (hasKey(dbcpProps, "minIdle") == null) {
|
||||||
dbcpProps.setProperty("minIdle", "0");
|
dbcpProps.setProperty("minIdle", "0");
|
||||||
}
|
}
|
||||||
if (hasKey(dbcpProps, "maxActive") == null) {
|
|
||||||
dbcpProps.setProperty("maxActive", "10");
|
|
||||||
}
|
|
||||||
|
|
||||||
return dbcpProps;
|
return dbcpProps;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue