You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@marmotta.apache.org by an...@apache.org on 2013/06/25 01:43:03 UTC

git commit: Fix potential unclosed connection if commit fails

Updated Branches:
  refs/heads/develop 66015fd5a -> 6b059824e


Fix potential unclosed connection if commit fails

Project: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/commit/6b059824
Tree: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/tree/6b059824
Diff: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/diff/6b059824

Branch: refs/heads/develop
Commit: 6b059824e2a1d547f7084abe5a90e5175b253cdc
Parents: 66015fd
Author: Peter Ansell <p_...@yahoo.com>
Authored: Tue Jun 25 09:42:38 2013 +1000
Committer: Peter Ansell <p_...@yahoo.com>
Committed: Tue Jun 25 09:42:38 2013 +1000

----------------------------------------------------------------------
 .../marmotta/ldclient/provider/rdf/SPARQLProvider.java      | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/6b059824/libraries/ldclient/ldclient-provider-rdf/src/main/java/org/apache/marmotta/ldclient/provider/rdf/SPARQLProvider.java
----------------------------------------------------------------------
diff --git a/libraries/ldclient/ldclient-provider-rdf/src/main/java/org/apache/marmotta/ldclient/provider/rdf/SPARQLProvider.java b/libraries/ldclient/ldclient-provider-rdf/src/main/java/org/apache/marmotta/ldclient/provider/rdf/SPARQLProvider.java
index ac8062e..cc39f14 100644
--- a/libraries/ldclient/ldclient-provider-rdf/src/main/java/org/apache/marmotta/ldclient/provider/rdf/SPARQLProvider.java
+++ b/libraries/ldclient/ldclient-provider-rdf/src/main/java/org/apache/marmotta/ldclient/provider/rdf/SPARQLProvider.java
@@ -152,9 +152,14 @@ public class SPARQLProvider extends AbstractHttpProvider {
                         public void endQueryResult() throws TupleQueryResultHandlerException   {
                             try {
                                 con.commit();
-                                con.close();
                             } catch (RepositoryException e) {
-                                throw new TupleQueryResultHandlerException("error while closing repository connection",e);
+                                throw new TupleQueryResultHandlerException("error while committing repository connection",e);
+                            } finally {
+                                try {
+                                    con.close();
+                                } catch(RepositoryException e) {
+                                    throw new TupleQueryResultHandlerException("error while closing repository connection",e);
+                                }
                             }
                         }