[jboss-svn-commits] JBL Code SVN: r21107 - labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Fri Jul 18 08:18:39 EDT 2008


Author: kevin.conner at jboss.com
Date: 2008-07-18 08:18:39 -0400 (Fri, 18 Jul 2008)
New Revision: 21107

Modified:
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/SqlTableGatewayListener.java
Log:
Fixed timestamp update: JBESB-1770

Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/SqlTableGatewayListener.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/SqlTableGatewayListener.java	2008-07-18 08:17:24 UTC (rev 21106)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/SqlTableGatewayListener.java	2008-07-18 12:18:39 UTC (rev 21107)
@@ -341,10 +341,13 @@
             throw new ConfigurationException(
                     "A valid inProcessField attribute must be specified");
         _timestamp = ListenerUtil.getValue(_config,
-        		JDBCEpr.TIMESTAMP_COLUMN_TAG, "");
-        if (_timestamp.trim().length() < 1) 
+        		JDBCEpr.TIMESTAMP_COLUMN_TAG);
+        if ((_timestamp == null)  || (_timestamp.trim().length() == 0))
+        {
             _logger.debug("No value specified for: "
                     + ListenerTagNames.SQL_TIMESTAMP_TAG);
+            _timestamp = null ;
+        }
         _where = ListenerUtil.getValue(_config,
                 ListenerTagNames.SQL_WHERE_CONDITION_TAG, "");
         if (_where.trim().length() < 1)
@@ -604,7 +607,7 @@
     protected String updateStatement() {
         StringBuilder sb = new StringBuilder().append("update ").append(
                 _tableName).append(" set ").append(_inProcessField).append(" = ? ");
-        if (_timestamp.trim().length() < 1) {
+        if (_timestamp != null) {
         	sb.append(", " + _timestamp + " = ? ");
         }
         sb.append("where ").append(_inProcessField).append(" = ?");
@@ -701,7 +704,7 @@
 
         try {
             int iParm = 3;
-            if (_timestamp.trim().length() < 1) {
+            if (_timestamp != null) {
             	iParm++;
             }
             
@@ -734,7 +737,7 @@
             try {
             	int counter = 1;
                 _PSupdate.setString(counter++, getStatus(toState));
-                if (_timestamp.trim().length() < 1) {
+                if (_timestamp != null) {
                 	Date now = new Date();
                 	_PSupdate.setString(counter++, now.toString());
                 }




More information about the jboss-svn-commits mailing list