use of com.sleepycat.je.DatabaseNotFoundException in project qpid-broker-j by apache.
the class AbstractBDBPreferenceStore method getPreferencesVersionDb.
private Database getPreferencesVersionDb() {
Database preferencesVersionDb;
try {
DatabaseConfig config = new DatabaseConfig().setTransactional(true).setAllowCreate(false);
preferencesVersionDb = getEnvironmentFacade().openDatabase(PREFERENCES_VERSION_DB_NAME, config);
} catch (DatabaseNotFoundException e) {
preferencesVersionDb = updateVersion(null, BrokerModel.MODEL_VERSION);
}
return preferencesVersionDb;
}
use of com.sleepycat.je.DatabaseNotFoundException in project qpid-broker-j by apache.
the class BDBLinkStore method getLinksVersionDb.
private Database getLinksVersionDb() {
Database linksVersionDb;
try {
DatabaseConfig config = new DatabaseConfig().setTransactional(true).setAllowCreate(false);
linksVersionDb = getEnvironmentFacade().openDatabase(LINKS_VERSION_DB_NAME, config);
} catch (DatabaseNotFoundException e) {
updateVersion(null, BrokerModel.MODEL_VERSION);
linksVersionDb = getEnvironmentFacade().openDatabase(LINKS_VERSION_DB_NAME, DEFAULT_DATABASE_CONFIG);
}
return linksVersionDb;
}
use of com.sleepycat.je.DatabaseNotFoundException in project BIMserver by opensourceBIM.
the class Database method initInternalStructure.
public void initInternalStructure(DatabaseSession databaseSession) throws BimserverLockConflictException, BimserverDatabaseException {
RecordIterator recordIterator = keyValueStore.getRecordIterator(CLASS_LOOKUP_TABLE, databaseSession);
try {
Record record = recordIterator.next();
while (record != null) {
String packageAndClassName = BinUtils.byteArrayToString(record.getValue());
String packageName = packageAndClassName.substring(0, packageAndClassName.indexOf("_"));
String className = packageAndClassName.substring(packageAndClassName.indexOf("_") + 1);
EClass eClass = (EClass) getEClassifier(packageName, className);
// TODO geometry?
boolean transactional = !(eClass.getEPackage() == Ifc2x3tc1Package.eINSTANCE || eClass.getEPackage() == Ifc4Package.eINSTANCE);
keyValueStore.openTable(databaseSession, packageAndClassName, transactional);
for (EStructuralFeature eStructuralFeature : eClass.getEAllStructuralFeatures()) {
if (eStructuralFeature.getEAnnotation("singleindex") != null) {
String indexTableName = eClass.getEPackage().getName() + "_" + eClass.getName() + "_" + eStructuralFeature.getName();
try {
keyValueStore.openIndexTable(databaseSession, indexTableName, transactional);
} catch (DatabaseNotFoundException e) {
}
}
}
Short cid = BinUtils.byteArrayToShort(record.getKey());
cidToEclass[cid] = eClass;
eClassToCid.put(eClass, cid);
record = recordIterator.next();
}
} finally {
recordIterator.close();
}
}
Aggregations