clerezza-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From enrid...@apache.org
Subject [1/2] git commit: CLEREZZA-872 CLEREZZA-874 Updated JDBC driver to 4.1 (from the latest vos 6 release). Fixed a bug on planB that was causing long literals to be added to a wrong graph name
Date Sun, 09 Feb 2014 19:50:30 GMT
Updated Branches:
  refs/heads/master 567cfd930 -> f45f35140


CLEREZZA-872 CLEREZZA-874 Updated JDBC driver to 4.1 (from the latest vos 6 release). Fixed
a bug on planB that was causing long literals to be added to a wrong graph name


Project: http://git-wip-us.apache.org/repos/asf/clerezza/repo
Commit: http://git-wip-us.apache.org/repos/asf/clerezza/commit/4a0dac85
Tree: http://git-wip-us.apache.org/repos/asf/clerezza/tree/4a0dac85
Diff: http://git-wip-us.apache.org/repos/asf/clerezza/diff/4a0dac85

Branch: refs/heads/master
Commit: 4a0dac8594f7e7f7807d9ad2cb716a8d5451ba04
Parents: b84bb59
Author: enridaga <enridaga@apache.org>
Authored: Sun Feb 9 19:49:55 2014 +0000
Committer: enridaga <enridaga@apache.org>
Committed: Sun Feb 9 19:49:55 2014 +0000

----------------------------------------------------------------------
 clerezza-virtuoso/ext.virtuoso.jdbc/pom.xml     |  3 ++-
 .../virtuoso/virtjdbc/maven-metadata-local.xml  |  3 ++-
 clerezza-virtuoso/rdf.virtuoso.storage/pom.xml  |  2 +-
 .../rdf/virtuoso/storage/VirtuosoMGraph.java    | 25 +++++++++++++++-----
 .../rdf/virtuoso/storage/ConnectionTest.java    |  2 +-
 .../java/rdf/virtuoso/storage/RdfIOTest.java    |  2 +-
 6 files changed, 26 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/clerezza/blob/4a0dac85/clerezza-virtuoso/ext.virtuoso.jdbc/pom.xml
----------------------------------------------------------------------
diff --git a/clerezza-virtuoso/ext.virtuoso.jdbc/pom.xml b/clerezza-virtuoso/ext.virtuoso.jdbc/pom.xml
index 5e4ad8f..e921bbb 100644
--- a/clerezza-virtuoso/ext.virtuoso.jdbc/pom.xml
+++ b/clerezza-virtuoso/ext.virtuoso.jdbc/pom.xml
@@ -29,6 +29,7 @@
 	<artifactId>ext.virtuoso.jdbc</artifactId>
 	<name>Clerezza/Virtuoso Ext - Virtuoso JDBC OSGi Bundle</name>
 	<description>Virtuoso JDBC</description>
+		<version>0.3-SNAPSHOT</version>
 	<repositories>
 		<repository>
 			<releases>
@@ -46,7 +47,7 @@
 			<groupId>virtuoso</groupId>
 			<artifactId>virtjdbc</artifactId>
 			<type>jar</type>
-			<version>4.0</version>
+			<version>4.1</version>
 		</dependency>
 	</dependencies>
 

http://git-wip-us.apache.org/repos/asf/clerezza/blob/4a0dac85/clerezza-virtuoso/ext.virtuoso.jdbc/src/main/resources/maven/repo/virtuoso/virtjdbc/maven-metadata-local.xml
----------------------------------------------------------------------
diff --git a/clerezza-virtuoso/ext.virtuoso.jdbc/src/main/resources/maven/repo/virtuoso/virtjdbc/maven-metadata-local.xml
b/clerezza-virtuoso/ext.virtuoso.jdbc/src/main/resources/maven/repo/virtuoso/virtjdbc/maven-metadata-local.xml
index f263a2e..a0d93d6 100644
--- a/clerezza-virtuoso/ext.virtuoso.jdbc/src/main/resources/maven/repo/virtuoso/virtjdbc/maven-metadata-local.xml
+++ b/clerezza-virtuoso/ext.virtuoso.jdbc/src/main/resources/maven/repo/virtuoso/virtjdbc/maven-metadata-local.xml
@@ -21,8 +21,9 @@
   <groupId>virtuoso</groupId>
   <artifactId>virtjdbc</artifactId>
   <versioning>
-    <release>4.0</release>
+    <release>4.1</release>
     <versions>
+      <version>4.1</version>
       <version>4.0</version>
     </versions>
   </versioning>

http://git-wip-us.apache.org/repos/asf/clerezza/blob/4a0dac85/clerezza-virtuoso/rdf.virtuoso.storage/pom.xml
----------------------------------------------------------------------
diff --git a/clerezza-virtuoso/rdf.virtuoso.storage/pom.xml b/clerezza-virtuoso/rdf.virtuoso.storage/pom.xml
index db67830..28443f1 100644
--- a/clerezza-virtuoso/rdf.virtuoso.storage/pom.xml
+++ b/clerezza-virtuoso/rdf.virtuoso.storage/pom.xml
@@ -47,7 +47,7 @@
 		<dependency>
 			<groupId>clerezza-virtuoso</groupId>
 			<artifactId>ext.virtuoso.jdbc</artifactId>
-			<version>[0,]</version>
+			<version>0.3-SNAPSHOT</version>
 			<scope>provided</scope>
 		</dependency>
 

http://git-wip-us.apache.org/repos/asf/clerezza/blob/4a0dac85/clerezza-virtuoso/rdf.virtuoso.storage/src/main/java/rdf/virtuoso/storage/VirtuosoMGraph.java
----------------------------------------------------------------------
diff --git a/clerezza-virtuoso/rdf.virtuoso.storage/src/main/java/rdf/virtuoso/storage/VirtuosoMGraph.java
b/clerezza-virtuoso/rdf.virtuoso.storage/src/main/java/rdf/virtuoso/storage/VirtuosoMGraph.java
index a020047..cf193d2 100644
--- a/clerezza-virtuoso/rdf.virtuoso.storage/src/main/java/rdf/virtuoso/storage/VirtuosoMGraph.java
+++ b/clerezza-virtuoso/rdf.virtuoso.storage/src/main/java/rdf/virtuoso/storage/VirtuosoMGraph.java
@@ -55,6 +55,7 @@ import virtuoso.jdbc4.VirtuosoException;
 import virtuoso.jdbc4.VirtuosoExtendedString;
 import virtuoso.jdbc4.VirtuosoRdfBox;
 import virtuoso.jdbc4.VirtuosoResultSet;
+import virtuoso.jdbc4.VirtuosoStatement;
 
 /**
  * Implementation of MGraph for the Virtuoso quad store.
@@ -191,7 +192,7 @@ public class VirtuosoMGraph extends AbstractMGraph implements MGraph,
 
 		String sql = sb.toString();
 //		logger.trace("Executing SQL: {}", sql);
-		Statement st = null;
+		VirtuosoStatement st = null;
 		List<Triple> list = null;
 		Exception e = null;
 		VirtuosoConnection connection = null;
@@ -199,10 +200,11 @@ public class VirtuosoMGraph extends AbstractMGraph implements MGraph,
 		try {
 			readLock.lock();
 			connection = provider.getConnection();
-			st = connection.createStatement();
+			st = (VirtuosoStatement) connection.createStatement();
 			st.execute(sql);
 			rs = (VirtuosoResultSet) st.getResultSet();
 			list = new ArrayList<Triple>();
+			
 			while (rs.next()) {
 				list.add(new TripleBuilder(rs.getObject(1), rs.getObject(2), rs
 						.getObject(3)).build());
@@ -223,13 +225,15 @@ public class VirtuosoMGraph extends AbstractMGraph implements MGraph,
 			try {
 				if (rs != null)
 					rs.close();
-			} catch (Exception ex) {
+			} catch (Throwable ex) {
+				logger.error("Cannot close result set", ex);
 			}
 			;
 			try {
 				if (st != null)
 					st.close();
-			} catch (Exception ex) {
+			} catch (Throwable ex) {
+				logger.error("Cannot close statement", ex);
 			}
 			;
 			try {
@@ -413,7 +417,7 @@ public class VirtuosoMGraph extends AbstractMGraph implements MGraph,
 		.append(" ")
 		.append(toVirtObject(triple.getObject()))
 		.append(" . ");
-		String sql = "db.dba.ttlp(?, '', '" + this.getName() + "2', 0)";
+		String sql = "db.dba.ttlp(?, '', '" + this.getName() + "', 0)";
 		logger.debug("Exec Plan B: {}", sql);
 		writeLock.lock();
 		VirtuosoConnection connection = null;
@@ -488,6 +492,7 @@ public class VirtuosoMGraph extends AbstractMGraph implements MGraph,
 		PreparedStatement st = null;
 		try {
 			connection = getConnection();
+			connection.setAutoCommit(false);
 			// st = connection.createStatement();
 			st = connection.prepareStatement(sql);
 			bindGraph(st, 1, new UriRef(getName()));
@@ -495,7 +500,14 @@ public class VirtuosoMGraph extends AbstractMGraph implements MGraph,
 			bindPredicate(st, 3, triple.getPredicate());
 			bindValue(st, 4, triple.getObject());
 			
-			st.execute();
+			try{
+				st.executeUpdate();
+				connection.commit();
+			}catch(VirtuosoException ve){
+				logger.error("FAILED ", ve);
+				connection.rollback();
+				throw ve;
+			}
 		} catch (VirtuosoException ve) {
 			logger.error("ERROR while executing statement", ve);
 			e = ve;
@@ -510,6 +522,7 @@ public class VirtuosoMGraph extends AbstractMGraph implements MGraph,
 				if (st != null)
 					st.close();
 			} catch (Exception ex) {
+				logger.error("Cannot close statement", ex);
 			}
 			;
 			if (connection != null) {

http://git-wip-us.apache.org/repos/asf/clerezza/blob/4a0dac85/clerezza-virtuoso/rdf.virtuoso.storage/src/test/java/rdf/virtuoso/storage/ConnectionTest.java
----------------------------------------------------------------------
diff --git a/clerezza-virtuoso/rdf.virtuoso.storage/src/test/java/rdf/virtuoso/storage/ConnectionTest.java
b/clerezza-virtuoso/rdf.virtuoso.storage/src/test/java/rdf/virtuoso/storage/ConnectionTest.java
index 40bd50c..87bb1a7 100644
--- a/clerezza-virtuoso/rdf.virtuoso.storage/src/test/java/rdf/virtuoso/storage/ConnectionTest.java
+++ b/clerezza-virtuoso/rdf.virtuoso.storage/src/test/java/rdf/virtuoso/storage/ConnectionTest.java
@@ -71,7 +71,7 @@ public class ConnectionTest {
 			log.warn("SKIPPED");
 			return;
 		}
-		assertFalse(connection.isConnectionLost());
+		assertFalse(connection.isConnectionLost(0));
 	}
 
 	@Test

http://git-wip-us.apache.org/repos/asf/clerezza/blob/4a0dac85/clerezza-virtuoso/rdf.virtuoso.storage/src/test/java/rdf/virtuoso/storage/RdfIOTest.java
----------------------------------------------------------------------
diff --git a/clerezza-virtuoso/rdf.virtuoso.storage/src/test/java/rdf/virtuoso/storage/RdfIOTest.java
b/clerezza-virtuoso/rdf.virtuoso.storage/src/test/java/rdf/virtuoso/storage/RdfIOTest.java
index a80697a..2633b29 100644
--- a/clerezza-virtuoso/rdf.virtuoso.storage/src/test/java/rdf/virtuoso/storage/RdfIOTest.java
+++ b/clerezza-virtuoso/rdf.virtuoso.storage/src/test/java/rdf/virtuoso/storage/RdfIOTest.java
@@ -123,7 +123,7 @@ public class RdfIOTest {
 		}
 		log.info("Test a long xsd:string");
 		StringBuilder longStr = new StringBuilder();
-		int c = 1500;
+		int c = 2500;
 		while (c > 0) {
 			longStr.append(" ");
 			c--;


Mime
View raw message