You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by ja...@apache.org on 2009/09/23 16:44:48 UTC
svn commit: r818123 - in
/ofbiz/trunk/framework/entity/src/org/ofbiz/entity/connection:
DBCPConnectionFactory.java MinervaConnectionFactory.java
XaPoolConnectionFactory.java
Author: jacopoc
Date: Wed Sep 23 14:44:48 2009
New Revision: 818123
URL: http://svn.apache.org/viewvc?rev=818123&view=rev
Log:
Better variable name (removed jotm prefix), no functional change.
Modified:
ofbiz/trunk/framework/entity/src/org/ofbiz/entity/connection/DBCPConnectionFactory.java
ofbiz/trunk/framework/entity/src/org/ofbiz/entity/connection/MinervaConnectionFactory.java
ofbiz/trunk/framework/entity/src/org/ofbiz/entity/connection/XaPoolConnectionFactory.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=818123&r1=818122&r2=818123&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 Wed Sep 23 14:44:48 2009
@@ -47,7 +47,7 @@
public static final String module = DBCPConnectionFactory.class.getName();
protected static Map<String, ManagedDataSource> dsCache = FastMap.newInstance();
- public Connection getConnection(String helperName, Element jotmJdbcElement) throws SQLException, GenericEntityException {
+ public Connection getConnection(String helperName, Element jdbcElement) throws SQLException, GenericEntityException {
ManagedDataSource mds = dsCache.get(helperName);
if (mds != null) {
return TransactionFactory.getCursorConnection(helperName, mds.getConnection());
@@ -61,26 +61,26 @@
// connection properties
TransactionManager txMgr = TransactionFactory.getTransactionManager();
- String driverName = jotmJdbcElement.getAttribute("jdbc-driver");
- String dbUri = jotmJdbcElement.getAttribute("jdbc-uri");
- String dbUser = jotmJdbcElement.getAttribute("jdbc-username");
- String dbPass = jotmJdbcElement.getAttribute("jdbc-password");
+ String driverName = jdbcElement.getAttribute("jdbc-driver");
+ String dbUri = jdbcElement.getAttribute("jdbc-uri");
+ String dbUser = jdbcElement.getAttribute("jdbc-username");
+ String dbPass = jdbcElement.getAttribute("jdbc-password");
// pool settings
int maxSize, minSize, timeBetweenEvictionRunsMillis;
try {
- maxSize = Integer.parseInt(jotmJdbcElement.getAttribute("pool-maxsize"));
+ maxSize = Integer.parseInt(jdbcElement.getAttribute("pool-maxsize"));
} catch (NumberFormatException nfe) {
- Debug.logError("Problems with pool settings [pool-maxsize=" + jotmJdbcElement.getAttribute("pool-maxsize") + "]; the values MUST be numbers, using default of 20.", module);
+ Debug.logError("Problems with pool settings [pool-maxsize=" + jdbcElement.getAttribute("pool-maxsize") + "]; the values MUST be numbers, using default of 20.", module);
maxSize = 20;
} catch (Exception e) {
Debug.logError("Problems with pool settings [pool-maxsize], using default of 20.", module);
maxSize = 20;
}
try {
- minSize = Integer.parseInt(jotmJdbcElement.getAttribute("pool-minsize"));
+ minSize = Integer.parseInt(jdbcElement.getAttribute("pool-minsize"));
} catch (NumberFormatException nfe) {
- Debug.logError("Problems with pool settings [pool-minsize=" + jotmJdbcElement.getAttribute("pool-minsize") + "]; the values MUST be numbers, using default of 2.", module);
+ Debug.logError("Problems with pool settings [pool-minsize=" + jdbcElement.getAttribute("pool-minsize") + "]; the values MUST be numbers, using default of 2.", module);
minSize = 2;
} catch (Exception e) {
Debug.logError("Problems with pool settings [pool-minsize], using default of 2.", module);
@@ -90,9 +90,9 @@
maxIdle = maxIdle > minSize ? maxIdle : minSize;
try {
- timeBetweenEvictionRunsMillis = Integer.parseInt(jotmJdbcElement.getAttribute("time-between-eviction-runs-millis"));
+ timeBetweenEvictionRunsMillis = Integer.parseInt(jdbcElement.getAttribute("time-between-eviction-runs-millis"));
} catch (NumberFormatException nfe) {
- Debug.logError("Problems with pool settings [time-between-eviction-runs-millis=" + jotmJdbcElement.getAttribute("time-between-eviction-runs-millis") + "]; the values MUST be numbers, using default of 600000.", module);
+ Debug.logError("Problems with pool settings [time-between-eviction-runs-millis=" + jdbcElement.getAttribute("time-between-eviction-runs-millis") + "]; the values MUST be numbers, using default of 600000.", module);
timeBetweenEvictionRunsMillis = 600000;
} catch (Exception e) {
Debug.logError("Problems with pool settings [time-between-eviction-runs-millis], using default of 600000.", module);
@@ -134,7 +134,7 @@
factory.setValidationQuery("select example_type_id from example_type limit 1");
factory.setDefaultReadOnly(false);
- String transIso = jotmJdbcElement.getAttribute("isolation-level");
+ String transIso = jdbcElement.getAttribute("isolation-level");
if (transIso != null && transIso.length() > 0) {
if ("Serializable".equals(transIso)) {
factory.setDefaultTransactionIsolation(Connection.TRANSACTION_SERIALIZABLE);
Modified: ofbiz/trunk/framework/entity/src/org/ofbiz/entity/connection/MinervaConnectionFactory.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/entity/src/org/ofbiz/entity/connection/MinervaConnectionFactory.java?rev=818123&r1=818122&r2=818123&view=diff
==============================================================================
--- ofbiz/trunk/framework/entity/src/org/ofbiz/entity/connection/MinervaConnectionFactory.java (original)
+++ ofbiz/trunk/framework/entity/src/org/ofbiz/entity/connection/MinervaConnectionFactory.java Wed Sep 23 14:44:48 2009
@@ -42,7 +42,7 @@
public static final String module = MinervaConnectionFactory.class.getName();
protected static Map<String, XAPoolDataSource> dsCache = FastMap.newInstance();
- public Connection getConnection(String helperName, Element jotmJdbcElement) throws SQLException, GenericEntityException {
+ public Connection getConnection(String helperName, Element jdbcElement) throws SQLException, GenericEntityException {
XAPoolDataSource pds = dsCache.get(helperName);
if (pds != null) {
return TransactionFactory.getCursorConnection(helperName, pds.getConnection());
@@ -62,10 +62,10 @@
if (ds == null)
throw new GenericEntityException("XADataSource was not created, big problem!");
- ds.setDriver(jotmJdbcElement.getAttribute("jdbc-driver"));
- ds.setURL(jotmJdbcElement.getAttribute("jdbc-uri"));
+ ds.setDriver(jdbcElement.getAttribute("jdbc-driver"));
+ ds.setURL(jdbcElement.getAttribute("jdbc-uri"));
- String transIso = jotmJdbcElement.getAttribute("isolation-level");
+ String transIso = jdbcElement.getAttribute("isolation-level");
if (transIso != null && transIso.length() > 0) {
if ("Serializable".equals(transIso)) {
pds.setTransactionIsolation(Connection.TRANSACTION_SERIALIZABLE);
@@ -82,26 +82,26 @@
// set the datasource in the pool
pds.setDataSource(ds);
- pds.setJDBCUser(jotmJdbcElement.getAttribute("jdbc-username"));
- pds.setJDBCPassword(jotmJdbcElement.getAttribute("jdbc-password"));
+ pds.setJDBCUser(jdbcElement.getAttribute("jdbc-username"));
+ pds.setJDBCPassword(jdbcElement.getAttribute("jdbc-password"));
// set the transaction manager in the pool
pds.setTransactionManager(TransactionFactory.getTransactionManager());
// configure the pool settings
try {
- pds.setMaxSize(Integer.parseInt(jotmJdbcElement.getAttribute("pool-maxsize")));
+ pds.setMaxSize(Integer.parseInt(jdbcElement.getAttribute("pool-maxsize")));
} catch (NumberFormatException nfe) {
- Debug.logError("Problems with pool settings [pool-maxsize=" + jotmJdbcElement.getAttribute("pool-maxsize") + "]; the values MUST be numbers, using default of 20.", module);
+ Debug.logError("Problems with pool settings [pool-maxsize=" + jdbcElement.getAttribute("pool-maxsize") + "]; the values MUST be numbers, using default of 20.", module);
pds.setMaxSize(20);
} catch (Exception e) {
Debug.logError(e, "Problems with pool settings", module);
pds.setMaxSize(20);
}
try {
- pds.setMinSize(Integer.parseInt(jotmJdbcElement.getAttribute("pool-minsize")));
+ pds.setMinSize(Integer.parseInt(jdbcElement.getAttribute("pool-minsize")));
} catch (NumberFormatException nfe) {
- Debug.logError("Problems with pool settings [pool-minsize=" + jotmJdbcElement.getAttribute("pool-minsize") + "]; the values MUST be numbers, using default of 5.", module);
+ Debug.logError("Problems with pool settings [pool-minsize=" + jdbcElement.getAttribute("pool-minsize") + "]; the values MUST be numbers, using default of 5.", module);
pds.setMinSize(2);
} catch (Exception e) {
Debug.logError(e, "Problems with pool settings", module);
Modified: ofbiz/trunk/framework/entity/src/org/ofbiz/entity/connection/XaPoolConnectionFactory.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/entity/src/org/ofbiz/entity/connection/XaPoolConnectionFactory.java?rev=818123&r1=818122&r2=818123&view=diff
==============================================================================
--- ofbiz/trunk/framework/entity/src/org/ofbiz/entity/connection/XaPoolConnectionFactory.java (original)
+++ ofbiz/trunk/framework/entity/src/org/ofbiz/entity/connection/XaPoolConnectionFactory.java Wed Sep 23 14:44:48 2009
@@ -42,7 +42,7 @@
protected static Map dsCache = new HashMap();
- public static Connection getConnection(String helperName, Element jotmJdbcElement) throws SQLException, GenericEntityException {
+ public static Connection getConnection(String helperName, Element jdbcElement) throws SQLException, GenericEntityException {
StandardXAPoolDataSource pds = (StandardXAPoolDataSource) dsCache.get(helperName);
if (pds != null) {
if (Debug.verboseOn()) Debug.logVerbose(helperName + " pool size: " + pds.pool.getCount(), module);
@@ -56,7 +56,7 @@
}
// the xapool wrapper class
- String wrapperClass = jotmJdbcElement.getAttribute("pool-xa-wrapper-class");
+ String wrapperClass = jdbcElement.getAttribute("pool-xa-wrapper-class");
StandardXADataSource ds = null;
try {
@@ -76,14 +76,14 @@
if (ds == null)
throw new GenericEntityException("StandardXaDataSource was not created, big problem!");
- ds.setDriverName(jotmJdbcElement.getAttribute("jdbc-driver"));
- ds.setUrl(jotmJdbcElement.getAttribute("jdbc-uri"));
- ds.setUser(jotmJdbcElement.getAttribute("jdbc-username"));
- ds.setPassword(jotmJdbcElement.getAttribute("jdbc-password"));
+ ds.setDriverName(jdbcElement.getAttribute("jdbc-driver"));
+ ds.setUrl(jdbcElement.getAttribute("jdbc-uri"));
+ ds.setUser(jdbcElement.getAttribute("jdbc-username"));
+ ds.setPassword(jdbcElement.getAttribute("jdbc-password"));
ds.setDescription(helperName);
ds.setTransactionManager(TransactionFactory.getTransactionManager());
- String transIso = jotmJdbcElement.getAttribute("isolation-level");
+ String transIso = jdbcElement.getAttribute("isolation-level");
if (transIso != null && transIso.length() > 0) {
if ("Serializable".equals(transIso)) {
((StandardXADataSource) ds).setTransactionIsolation(Connection.TRANSACTION_SERIALIZABLE);
@@ -110,15 +110,15 @@
// configure the pool settings
try {
- pds.setMaxSize(Integer.parseInt(jotmJdbcElement.getAttribute("pool-maxsize")));
- pds.setMinSize(Integer.parseInt(jotmJdbcElement.getAttribute("pool-minsize")));
- pds.setSleepTime(Long.parseLong(jotmJdbcElement.getAttribute("pool-sleeptime")));
- pds.setLifeTime(Long.parseLong(jotmJdbcElement.getAttribute("pool-lifetime")));
- pds.setDeadLockMaxWait(Long.parseLong(jotmJdbcElement.getAttribute("pool-deadlock-maxwait")));
- pds.setDeadLockRetryWait(Long.parseLong(jotmJdbcElement.getAttribute("pool-deadlock-retrywait")));
+ pds.setMaxSize(Integer.parseInt(jdbcElement.getAttribute("pool-maxsize")));
+ pds.setMinSize(Integer.parseInt(jdbcElement.getAttribute("pool-minsize")));
+ pds.setSleepTime(Long.parseLong(jdbcElement.getAttribute("pool-sleeptime")));
+ pds.setLifeTime(Long.parseLong(jdbcElement.getAttribute("pool-lifetime")));
+ pds.setDeadLockMaxWait(Long.parseLong(jdbcElement.getAttribute("pool-deadlock-maxwait")));
+ pds.setDeadLockRetryWait(Long.parseLong(jdbcElement.getAttribute("pool-deadlock-retrywait")));
// set the test statement to test connections
- String testStmt = jotmJdbcElement.getAttribute("pool-jdbc-test-stmt");
+ String testStmt = jdbcElement.getAttribute("pool-jdbc-test-stmt");
if (testStmt != null && testStmt.length() > 0) {
pds.setJdbcTestStmt(testStmt);
Debug.logInfo("Set JDBC Test Statement : " + testStmt, module);