}
public static ODatabaseRecordTx open(String appcode, String username,String password) throws InvalidAppCodeException {
if (appcode==null || !appcode.equals(BBConfiguration.configuration.getString(BBConfiguration.APP_CODE)))
throw new InvalidAppCodeException("Authentication info not valid or not provided: " + appcode + " is an Invalid App Code");
if(dbFreeze.get()){
throw new ShuttingDownDBException();
}
String databaseName=BBConfiguration.getDBDir();
if (Logger.isDebugEnabled()) Logger.debug("opening connection on db: " + databaseName + " for " + username);