db-ddlutils-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From to...@apache.org
Subject svn commit: r572520 - /db/ddlutils/trunk/src/java/org/apache/ddlutils/io/DataToDatabaseSink.java
Date Tue, 04 Sep 2007 04:53:59 GMT
Author: tomdz
Date: Mon Sep  3 21:53:58 2007
New Revision: 572520

URL: http://svn.apache.org/viewvc?rev=572520&view=rev
Log:
Check for existence of connection before trying to close it

Modified:
    db/ddlutils/trunk/src/java/org/apache/ddlutils/io/DataToDatabaseSink.java

Modified: db/ddlutils/trunk/src/java/org/apache/ddlutils/io/DataToDatabaseSink.java
URL: http://svn.apache.org/viewvc/db/ddlutils/trunk/src/java/org/apache/ddlutils/io/DataToDatabaseSink.java?rev=572520&r1=572519&r2=572520&view=diff
==============================================================================
--- db/ddlutils/trunk/src/java/org/apache/ddlutils/io/DataToDatabaseSink.java (original)
+++ db/ddlutils/trunk/src/java/org/apache/ddlutils/io/DataToDatabaseSink.java Mon Sep  3 21:53:58
2007
@@ -210,13 +210,16 @@
     public void end() throws DataSinkException
     {
         purgeBatchQueue();
-        try
+        if (_connection != null)
         {
-            _connection.close();
-        }
-        catch (SQLException ex)
-        {
-            throw new DataSinkException(ex);
+            try
+            {
+                _connection.close();
+            }
+            catch (SQLException ex)
+            {
+                throw new DataSinkException(ex);
+            }
         }
         if (!_waitingObjects.isEmpty())
         {



Mime
View raw message