Search in sources :

Example 1 with CappedTransactionContext

use of com.b2international.snowowl.core.domain.CappedTransactionContext in project snow-owl by b2ihealthcare.

the class VersioningRequest method execute.

@Override
public final Boolean execute(TransactionContext context) {
    final Logger log = context.log();
    log.info("Versioning components of '{}' resource...", config.getResource());
    try {
        // capped context to commit versioned components in the configured low watermark bulks
        try (CappedTransactionContext versioningContext = new CappedTransactionContext(context, getCommitLimit(context))) {
            doVersionComponents(versioningContext);
        }
    } catch (Exception e) {
        if (e instanceof ApiException) {
            throw (ApiException) e;
        }
        throw new SnowowlRuntimeException(e);
    }
    return Boolean.TRUE;
}
Also used : CappedTransactionContext(com.b2international.snowowl.core.domain.CappedTransactionContext) Logger(org.slf4j.Logger) SnowowlRuntimeException(com.b2international.snowowl.core.api.SnowowlRuntimeException) ApiException(com.b2international.commons.exceptions.ApiException) SnowowlRuntimeException(com.b2international.snowowl.core.api.SnowowlRuntimeException) ApiException(com.b2international.commons.exceptions.ApiException)

Aggregations

ApiException (com.b2international.commons.exceptions.ApiException)1 SnowowlRuntimeException (com.b2international.snowowl.core.api.SnowowlRuntimeException)1 CappedTransactionContext (com.b2international.snowowl.core.domain.CappedTransactionContext)1 Logger (org.slf4j.Logger)1