[jboss-svn-commits] JBL Code SVN: r17975 - in labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/rosetta/src/org/jboss/soa/esb: listeners/gateway and 1 other directory.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Sat Jan 19 05:27:42 EST 2008
Author: mark.little at jboss.com
Date: 2008-01-19 05:27:42 -0500 (Sat, 19 Jan 2008)
New Revision: 17975
Modified:
labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/rosetta/src/org/jboss/soa/esb/helpers/persist/JdbcCleanConn.java
labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/SqlTableGatewayListener.java
Log:
http://jira.jboss.com/jira/browse/JBESB-1502
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/rosetta/src/org/jboss/soa/esb/helpers/persist/JdbcCleanConn.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/rosetta/src/org/jboss/soa/esb/helpers/persist/JdbcCleanConn.java 2008-01-19 10:24:00 UTC (rev 17974)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/rosetta/src/org/jboss/soa/esb/helpers/persist/JdbcCleanConn.java 2008-01-19 10:27:42 UTC (rev 17975)
@@ -63,6 +63,8 @@
{
m_conn.commit();
}
+ else
+ throw new SQLException("Connection is null!");
}
public void rollback() throws SQLException
@@ -107,6 +109,9 @@
{
}
}
+ else
+ m_oLogger.debug("Connection is null.");
+
m_olPrepSt.clear();
m_conn = null;
} // __________________________________
@@ -117,6 +122,9 @@
if (null == m_conn)
{
connect();
+
+ if (m_conn == null)
+ throw new SQLException("Connection is null!");
}
PreparedStatement PS = m_conn.prepareStatement(p_sSt, p_i1, p_i2);
m_olPrepSt.add(PS);
@@ -128,6 +136,9 @@
if (null == m_conn)
{
connect();
+
+ if (m_conn == null)
+ throw new SQLException("Connection is null!");
}
PreparedStatement PS = m_conn.prepareStatement(p_sSt);
@@ -141,6 +152,9 @@
if (null == m_conn)
{
connect();
+
+ if (m_conn == null)
+ throw new SQLException("Connection is null!");
}
if (p_PS == null)
@@ -181,6 +195,9 @@
if (null == m_conn)
{
connect();
+
+ if (m_conn == null)
+ throw new SQLException("Connection is null!");
}
if (p_PS == null)
@@ -225,6 +242,9 @@
return;
}
+ if (m_oDS == null)
+ throw new SQLException("DataSource is null!");
+
SQLException eRet = null;
for (int i1 = 0; i1 < 5; i1++)
{
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/SqlTableGatewayListener.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/SqlTableGatewayListener.java 2008-01-19 10:24:00 UTC (rev 17974)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/SqlTableGatewayListener.java 2008-01-19 10:27:42 UTC (rev 17975)
@@ -541,9 +541,16 @@
initContext = new InitialContext();
oDS = (DataSource) initContext.lookup(_datasource);
} catch (NamingException e) {
- _logger.error("", e);
+ _logger.error("SqlTableGatewayListener.getDbConn failed to lookup datasource.", e);
}
}
+
+ /*
+ * Create JdbcCleanConn even if oDS is null because that will
+ * manage the error handling for us by throwing SQLExceptions
+ * at the appropriate time.
+ */
+
_dbConn = new JdbcCleanConn(oDS);
}
@@ -551,7 +558,7 @@
try {
prepareStatements();
} catch (SQLException e) {
- _logger.debug("Exception preparing statements", e);
+ _logger.warn("Exception preparing statements", e);
}
}
More information about the jboss-svn-commits
mailing list