Strabon

changeset 80:28bce4140e1f

added comments and correct author information
author Babis Nikolaou <charnik@di.uoa.gr>
date Tue Mar 27 16:03:11 2012 +0300 (2012-03-27)
parents 2ac2820a0b13
children 86e205ec5819
files monetdb/src/main/java/org/openrdf/sail/monetdb/MonetDBConnectionFactory.java
line diff
     1.1 --- a/monetdb/src/main/java/org/openrdf/sail/monetdb/MonetDBConnectionFactory.java	Fri Mar 23 15:05:39 2012 +0200
     1.2 +++ b/monetdb/src/main/java/org/openrdf/sail/monetdb/MonetDBConnectionFactory.java	Tue Mar 27 16:03:11 2012 +0300
     1.3 @@ -5,7 +5,6 @@
     1.4   */
     1.5  package org.openrdf.sail.monetdb;
     1.6  
     1.7 -import static java.sql.Connection.TRANSACTION_READ_COMMITTED;
     1.8  import static java.sql.Connection.TRANSACTION_SERIALIZABLE;
     1.9  import info.aduna.concurrent.locks.Lock;
    1.10  
    1.11 @@ -19,23 +18,20 @@
    1.12  import org.openrdf.sail.generaldb.GeneralDBTripleRepository;
    1.13  import org.openrdf.sail.generaldb.evaluation.GeneralDBEvaluationFactory;
    1.14  import org.openrdf.sail.generaldb.evaluation.GeneralDBQueryBuilderFactory;
    1.15 +import org.openrdf.sail.generaldb.managers.TransTableManager;
    1.16 +import org.openrdf.sail.generaldb.managers.TripleManager;
    1.17  import org.openrdf.sail.generaldb.optimizers.GeneralDBQueryOptimizer;
    1.18  import org.openrdf.sail.generaldb.optimizers.GeneralDBSelectQueryOptimizerFactory;
    1.19 +import org.openrdf.sail.generaldb.schema.ValueTableFactory;
    1.20  import org.openrdf.sail.helpers.DefaultSailChangedEvent;
    1.21  import org.openrdf.sail.monetdb.evaluation.MonetDBEvaluationFactory;
    1.22  import org.openrdf.sail.monetdb.evaluation.MonetDBQueryBuilderFactory;
    1.23  import org.openrdf.sail.monetdb.util.MonetDBLockManager;
    1.24  import org.openrdf.sail.rdbms.exceptions.RdbmsException;
    1.25 -import org.openrdf.sail.generaldb.managers.TransTableManager;
    1.26 -import org.openrdf.sail.generaldb.managers.TripleManager;
    1.27  import org.openrdf.sail.rdbms.schema.TableFactory;
    1.28 -import org.openrdf.sail.generaldb.schema.ValueTableFactory;
    1.29  
    1.30 -/**
    1.31 - * Responsible to initialise and wire all components together that will be
    1.32 - * needed to satisfy any sail connection request.
    1.33 - * 
    1.34 - * @author James Leigh
    1.35 +/** 
    1.36 + * @author George Garbis <ggarbis@di.uoa.gr> ??
    1.37   */
    1.38  public class MonetDBConnectionFactory extends GeneralDBConnectionFactory {
    1.39  
    1.40 @@ -92,15 +88,14 @@
    1.41  			 */
    1.42  			Connection db = nsAndTableIndexes;
    1.43  			db.setAutoCommit(true);
    1.44 -			/**************************/
    1.45 -//			if (db.getTransactionIsolation() != TRANSACTION_READ_COMMITTED) {
    1.46 -//				db.setTransactionIsolation(TRANSACTION_READ_COMMITTED);
    1.47 -//			}
    1.48 -			// giorgos
    1.49 -			if (db.getTransactionIsolation() != TRANSACTION_SERIALIZABLE) {
    1.50 -				db.setTransactionIsolation(TRANSACTION_SERIALIZABLE);
    1.51 -			}
    1.52 -			/***********************/
    1.53 +
    1.54 +			/**
    1.55 +			 * In contrast to Postgres, MonetDB (actually the jdbc implementation of MonetDB) allows 
    1.56 +			 * only serializable transactions. In every other case, an exception (or warning) is thrown.
    1.57 +			 * To prevent this, we explicitly set the isolation level to TRANSACTION_SERIALIZABLE.   
    1.58 +			 */
    1.59 +			db.setTransactionIsolation(TRANSACTION_SERIALIZABLE);
    1.60 +			
    1.61  			TripleManager tripleManager = new TripleManager();
    1.62  			GeneralDBTripleRepository s = new MonetDBTripleRepository();
    1.63  			s.setTripleManager(tripleManager);