Strabon

changeset 1034:95c7633544ad

fixes bug #41. Now, TransTableManager.getTable() always calls TripleTableManager.flushManager(), but flushing is done only when the underlying connection is a MonetDB one. For this it was needed to add a dependency to generaldb/pom.xml to the jdbc implementation of MonetDB. For some reason, a dependency to the jdbc implementation of PostgreSQL was already there as a dependency.

NOTE: You have to update your project configuration in Eclipse
author Babis Nikolaou <charnik@di.uoa.gr>
date Mon Apr 15 18:39:56 2013 +0300 (2013-04-15)
parents d5b38e937951
children 6260271ba203 0944a501d988
files generaldb/pom.xml generaldb/src/main/java/org/openrdf/sail/generaldb/managers/TransTableManager.java generaldb/src/main/java/org/openrdf/sail/generaldb/managers/TripleTableManager.java
line diff
     1.1 --- a/generaldb/pom.xml	Mon Apr 15 18:03:10 2013 +0300
     1.2 +++ b/generaldb/pom.xml	Mon Apr 15 18:39:56 2013 +0300
     1.3 @@ -78,6 +78,13 @@
     1.4  			<artifactId>postgresql</artifactId>
     1.5  			<scope>provided</scope>
     1.6  		</dependency>
     1.7 +		
     1.8 +		<dependency>
     1.9 +			<groupId>monetdb</groupId>
    1.10 +			<artifactId>jdbcclient</artifactId>
    1.11 +			<scope>provided</scope>
    1.12 +		</dependency>
    1.13 +		
    1.14   		
    1.15  		<dependency>
    1.16  			<groupId>junit</groupId>
     2.1 --- a/generaldb/src/main/java/org/openrdf/sail/generaldb/managers/TransTableManager.java	Mon Apr 15 18:03:10 2013 +0300
     2.2 +++ b/generaldb/src/main/java/org/openrdf/sail/generaldb/managers/TransTableManager.java	Mon Apr 15 18:39:56 2013 +0300
     2.3 @@ -244,7 +244,12 @@
     2.4  		synchronized (tables) {
     2.5  			TransactionTable table = tables.get(pred);
     2.6  			if (table == null) {
     2.7 -				//triples.flushManagers();// charnik's addition (see flushManagers() method for details)
     2.8 +				/**
     2.9 +				 * @author charnik
    2.10 +				 * @see method {@link TripleTableManager#flushManagers()} for details
    2.11 +				 */
    2.12 +				triples.flushManagers();
    2.13 +				
    2.14  				TripleTable predicate = triples.getPredicateTable(pred);
    2.15  				Number key = pred;
    2.16  				if (predicate.isPredColumnPresent()) {
     3.1 --- a/generaldb/src/main/java/org/openrdf/sail/generaldb/managers/TripleTableManager.java	Mon Apr 15 18:03:10 2013 +0300
     3.2 +++ b/generaldb/src/main/java/org/openrdf/sail/generaldb/managers/TripleTableManager.java	Mon Apr 15 18:39:56 2013 +0300
     3.3 @@ -31,8 +31,8 @@
     3.4  /**
     3.5   * Manages and delegates to the collection of {@link TripleTable}.
     3.6   * 
     3.7 - * @author James Leigh
     3.8 - * 
     3.9 + * @author Charalampos Nikolaou <charnik@di.uoa.gr>
    3.10 + * @author Manos Karpathiotakis <mk@di.uoa.gr>
    3.11   */
    3.12  public class TripleTableManager {
    3.13  
    3.14 @@ -466,7 +466,6 @@
    3.15  	}
    3.16  	
    3.17  	/**
    3.18 -	 * my addition
    3.19  	 * @return the hashmanager of the tripletablemanager
    3.20  	 */
    3.21  	public HashManager getHashManager()
    3.22 @@ -483,21 +482,24 @@
    3.23  	 * creation of the table was making MonetDB to release all prepared statements
    3.24  	 * that have already been created but not executed.
    3.25  	 * 
    3.26 +	 * @see {@link TransTableManager#getTable(Number)}
    3.27 +	 * 
    3.28  	 * FIXME: Should it throw those exceptions? 
    3.29  	 */
    3.30  	public void flushManagers() {
    3.31 -		try {
    3.32 -			bnodes.flush();
    3.33 -			uris.flush();
    3.34 -			literals.flush();
    3.35 -			
    3.36 -		} catch (SQLException e) {
    3.37 -			// TODO Auto-generated catch block
    3.38 -			e.printStackTrace();
    3.39 -		} catch (InterruptedException e) {
    3.40 -			// TODO Auto-generated catch block
    3.41 -			e.printStackTrace();
    3.42 +		if (conn instanceof nl.cwi.monetdb.jdbc.MonetConnection) {
    3.43 +		//if (! (conn instanceof org.postgresql.jdbc4.Jdbc4Connection)) {
    3.44 +			try {
    3.45 +				bnodes.flush();
    3.46 +				uris.flush();
    3.47 +				literals.flush();
    3.48 +				
    3.49 +			} catch (SQLException e) {
    3.50 +				e.printStackTrace();
    3.51 +				
    3.52 +			} catch (InterruptedException e) {
    3.53 +				e.printStackTrace();
    3.54 +			}
    3.55  		}
    3.56 -		
    3.57  	}
    3.58  }