fix for NIHVIVO-1833

This commit is contained in:
sjm222 2011-01-25 19:16:44 +00:00
parent d4469248ea
commit 4c1bbde7d9

View file

@ -111,7 +111,7 @@ public class JenaDataSourceSetupSDB extends JenaDataSourceSetupBase implements j
setApplicationStore(store, sce.getServletContext()); setApplicationStore(store, sce.getServletContext());
if (!isSetUp(store)) { if (!isSetUp(store)) {
log.debug("Non-SDB system detected. Setting up SDB store"); log.info("Non-SDB system detected. Setting up SDB store");
setupSDB(sce.getServletContext(), store, memModel, inferenceModel); setupSDB(sce.getServletContext(), store, memModel, inferenceModel);
} }
@ -577,17 +577,14 @@ public class JenaDataSourceSetupSDB extends JenaDataSourceSetupBase implements j
} }
/** /**
* Tests whether an SDB store has been formatted for use. * Tests whether an SDB store has been formatted and populated for use.
* @param store * @param store
* @return * @return
*/ */
private boolean isSetUp(Store store) { private boolean isSetUp(Store store) {
try { try {
// a test query to see if the store is formatted return (SDBFactory.connectNamedModel(store, JenaDataSourceSetupBase.JENA_TBOX_ASSERTIONS_MODEL)).size() > 0;
SDBFactory.connectDefaultModel(store).contains( } catch (Exception e) {
OWL.Thing, RDF.type, OWL.Nothing);
return true;
} catch (Exception e) { // unformatted store
return false; return false;
} }
} }