improved detection of unformatted SDB store

This commit is contained in:
bjl23 2011-02-07 15:58:24 +00:00
parent e028e17010
commit 5dead7cbd5

View file

@ -650,12 +650,17 @@ public class JenaDataSourceSetupSDB extends JenaDataSourceSetupBase implements j
* @return * @return
*/ */
private boolean isSetUp(Store store) throws SQLException { private boolean isSetUp(Store store) throws SQLException {
return StoreUtils.isFormatted(store); if (!(StoreUtils.isFormatted(store))) {
// try { return false;
// return (SDBFactory.connectNamedModel(store, JenaDataSourceSetupBase.JENA_TBOX_ASSERTIONS_MODEL)).size() > 0; }
// } catch (Exception e) {
// return false; // even if the store exists, it may be empty
// }
try {
return (SDBFactory.connectNamedModel(store, JenaDataSourceSetupBase.JENA_TBOX_ASSERTIONS_MODEL)).size() > 0;
} catch (Exception e) {
return false;
}
} }
private static final String STOREDESC_ATTR = "storeDesc"; private static final String STOREDESC_ATTR = "storeDesc";