Strabon

changeset 979:04f844c4e2b9

merge.
author Panayiotis Smeros <psmeros@di.uoa.gr>
date Fri Apr 05 11:59:56 2013 +0300 (2013-04-05)
parents 23ec0f6954c2 1c9314288714
children 2171270604e1 d00ae93c1714
files
line diff
     1.1 --- a/generaldb/src/main/java/org/openrdf/sail/generaldb/GeneralDBConnectionFactory.java	Fri Apr 05 11:59:22 2013 +0300
     1.2 +++ b/generaldb/src/main/java/org/openrdf/sail/generaldb/GeneralDBConnectionFactory.java	Fri Apr 05 11:59:56 2013 +0300
     1.3 @@ -5,45 +5,39 @@
     1.4   */
     1.5  package org.openrdf.sail.generaldb;
     1.6  
     1.7 -import static java.sql.Connection.TRANSACTION_READ_COMMITTED;
     1.8 +import info.aduna.concurrent.locks.ExclusiveLockManager;
     1.9 +import info.aduna.concurrent.locks.Lock;
    1.10  
    1.11  import java.sql.Connection;
    1.12  import java.sql.SQLException;
    1.13  
    1.14  import javax.sql.DataSource;
    1.15  
    1.16 -import info.aduna.concurrent.locks.ExclusiveLockManager;
    1.17 -import info.aduna.concurrent.locks.Lock;
    1.18 -
    1.19  import org.openrdf.model.impl.ValueFactoryImpl;
    1.20  import org.openrdf.sail.SailConnection;
    1.21  import org.openrdf.sail.SailException;
    1.22 -import org.openrdf.sail.helpers.DefaultSailChangedEvent;
    1.23 -import org.openrdf.sail.generaldb.evaluation.GeneralDBEvaluationFactory;
    1.24  import org.openrdf.sail.generaldb.evaluation.GeneralDBQueryBuilderFactory;
    1.25 -import org.openrdf.sail.generaldb.optimizers.GeneralDBQueryOptimizer;
    1.26 -import org.openrdf.sail.generaldb.optimizers.GeneralDBSelectQueryOptimizerFactory;
    1.27 -import org.openrdf.sail.rdbms.exceptions.RdbmsException;
    1.28  import org.openrdf.sail.generaldb.managers.BNodeManager;
    1.29  import org.openrdf.sail.generaldb.managers.HashManager;
    1.30  import org.openrdf.sail.generaldb.managers.LiteralManager;
    1.31 -import org.openrdf.sail.rdbms.managers.NamespaceManager;
    1.32  import org.openrdf.sail.generaldb.managers.PredicateManager;
    1.33  import org.openrdf.sail.generaldb.managers.TransTableManager;
    1.34 -import org.openrdf.sail.generaldb.managers.TripleManager;
    1.35  import org.openrdf.sail.generaldb.managers.TripleTableManager;
    1.36  import org.openrdf.sail.generaldb.managers.UriManager;
    1.37 +import org.openrdf.sail.generaldb.optimizers.GeneralDBQueryOptimizer;
    1.38 +import org.openrdf.sail.generaldb.optimizers.GeneralDBSelectQueryOptimizerFactory;
    1.39  import org.openrdf.sail.generaldb.schema.BNodeTable;
    1.40  import org.openrdf.sail.generaldb.schema.HashTable;
    1.41  import org.openrdf.sail.generaldb.schema.IdSequence;
    1.42  import org.openrdf.sail.generaldb.schema.IntegerIdSequence;
    1.43  import org.openrdf.sail.generaldb.schema.LiteralTable;
    1.44  import org.openrdf.sail.generaldb.schema.LongIdSequence;
    1.45 +import org.openrdf.sail.generaldb.schema.URITable;
    1.46 +import org.openrdf.sail.generaldb.schema.ValueTableFactory;
    1.47 +import org.openrdf.sail.rdbms.exceptions.RdbmsException;
    1.48 +import org.openrdf.sail.rdbms.managers.NamespaceManager;
    1.49  import org.openrdf.sail.rdbms.schema.NamespacesTable;
    1.50  import org.openrdf.sail.rdbms.schema.TableFactory;
    1.51 -import org.openrdf.sail.generaldb.schema.URITable;
    1.52 -import org.openrdf.sail.generaldb.schema.ValueTableFactory;
    1.53 -import org.openrdf.sail.rdbms.util.DatabaseLockManager;
    1.54  import org.openrdf.sail.rdbms.util.Tracer;
    1.55  
    1.56  /**
    1.57 @@ -185,6 +179,7 @@
    1.58  			literalManager = new LiteralManager();
    1.59  			ValueTableFactory tables = createValueTableFactory();
    1.60  			tables.setSequenced(sequenced);
    1.61 +			
    1.62  			if (sequenced) {
    1.63  				ids = new IntegerIdSequence();
    1.64  				tables.setIdSequence(ids);
    1.65 @@ -200,11 +195,14 @@
    1.66  				hashManager.setUriManager(uriManager);
    1.67  				hashManager.setIdSequence(ids);
    1.68  				hashManager.init();
    1.69 +				
    1.70  			} else {
    1.71  				ids = new LongIdSequence();
    1.72  				ids.init();
    1.73  				tables.setIdSequence(ids);
    1.74 +				
    1.75  			}
    1.76 +			
    1.77  			namespaces = new NamespaceManager();
    1.78  			namespaces.setConnection(resourceInserts);
    1.79  			NamespacesTable nsTable = tables.createNamespacesTable(nsAndTableIndexes);
    1.80 @@ -239,11 +237,15 @@
    1.81  			tripleTableManager.setMaxNumberOfTripleTables(maxTripleTables);
    1.82  			tripleTableManager.setIndexingTriples(triplesIndexed);
    1.83  			tripleTableManager.initialize();
    1.84 +			
    1.85  			if (triplesIndexed) {
    1.86  				tripleTableManager.createTripleIndexes();
    1.87 +				
    1.88  			} else {
    1.89  				tripleTableManager.dropTripleIndexes();
    1.90 +				
    1.91  			}
    1.92 +			
    1.93  			bnodeManager.setTable(bnodeTable);
    1.94  			bnodeManager.init();
    1.95  			vf.setBNodeManager(bnodeManager);
    1.96 @@ -252,6 +254,7 @@
    1.97  			literalManager.init();
    1.98  			vf.setLiteralManager(literalManager);
    1.99  			vf.setPredicateManager(predicateManager);
   1.100 +			
   1.101  		} catch (SQLException e) {
   1.102  			throw new RdbmsException(e);
   1.103  		}