Search in sources :

Example 1 with ExclusiveWriteBackendTransaction

use of com.torodb.core.backend.ExclusiveWriteBackendTransaction in project torodb by torodb.

the class StampedeService method dropDatabase.

private void dropDatabase(BackendService backendService) throws UserException {
    try (BackendConnection conn = backendService.openConnection();
        ExclusiveWriteBackendTransaction trans = conn.openExclusiveWriteTransaction()) {
        trans.dropUserData();
        trans.commit();
    }
}
Also used : BackendConnection(com.torodb.core.backend.BackendConnection) ExclusiveWriteBackendTransaction(com.torodb.core.backend.ExclusiveWriteBackendTransaction)

Example 2 with ExclusiveWriteBackendTransaction

use of com.torodb.core.backend.ExclusiveWriteBackendTransaction in project torodb by torodb.

the class BackendBundleImpl method postDependenciesStartUp.

@Override
protected void postDependenciesStartUp() throws Exception {
    lowLevelService.startAsync();
    lowLevelService.awaitRunning();
    backendService.startAsync();
    backendService.awaitRunning();
    try (BackendConnection conn = backendService.openConnection();
        ExclusiveWriteBackendTransaction trans = conn.openExclusiveWriteTransaction()) {
        trans.checkOrCreateMetaDataTables();
        trans.commit();
    }
}
Also used : BackendConnection(com.torodb.core.backend.BackendConnection) ExclusiveWriteBackendTransaction(com.torodb.core.backend.ExclusiveWriteBackendTransaction)

Aggregations

BackendConnection (com.torodb.core.backend.BackendConnection)2 ExclusiveWriteBackendTransaction (com.torodb.core.backend.ExclusiveWriteBackendTransaction)2