@Override public Transaction startShort() { return delegate.startShort(); }
@Override public Transaction startShort(int timeout) { return delegate.startShort(timeout); }
@Override public Transaction startShort() { return delegate.startShort(); }
@Override public Transaction startShort(int timeout) { return delegate.startShort(timeout); }
@Override public Transaction startShort(int timeout) { return delegate.startShort(timeout); }
@Override public Transaction startShort() { return delegate.startShort(); }
@Override public Transaction startShort() { return delegate.startShort(); }
@Override public Transaction startShort(int timeout) { try { return delegate.startShort(timeout); } catch (RuntimeException e) { throw handleException(e); } }
@Override public void start(int timeout) throws TransactionFailureException { Preconditions.checkState(currentTx == null, "Already have an active transaction."); currentTx = txClient.startShort(timeout); startAllTxAwares(); }
@Override public Transaction startShort() { try { return delegate.startShort(); } catch (RuntimeException e) { throw handleException(e); } }
@Override public void start() throws TransactionFailureException { Preconditions.checkState(currentTx == null, "Already have an active transaction."); currentTx = txClient.startShort(); startAllTxAwares(); }
@Override public void start() throws TransactionFailureException { Preconditions.checkState(currentTx == null, "Already have an active transaction."); currentTx = txClient.startShort(); startAllTxAwares(); }
@Override public Transaction startShort(final int timeout) { return supplyWithRetries(() -> delegate.startShort(timeout)); } }
@Override public void start(int timeout) throws TransactionFailureException { Preconditions.checkState(currentTx == null, "Already have an active transaction."); currentTx = txClient.startShort(timeout); startAllTxAwares(); }
@Override public Transaction startShort(final int timeout) { return supplyWithRetries(() -> delegate.startShort(timeout)); } }
@Override public Transaction startShort() { try { return delegate.startShort(); } catch (RuntimeException e) { throw handleException(e); } }
@Override public Transaction startShort(int timeout) { try { return delegate.startShort(timeout); } catch (RuntimeException e) { throw handleException(e); } }
/** * Starts a new transaction. Calling this will initiate a new transaction using the {@link TransactionSystemClient}, * and pass the returned transaction to {@link TransactionAware#startTx(Transaction)} for each registered * TransactionAware. If an exception is encountered, the transaction will be aborted and a * {@code TransactionFailureException} wrapping the root cause will be thrown. * * @throws TransactionFailureException if an exception occurs starting the transaction with any registered * TransactionAware */ public void start() throws TransactionFailureException { currentTx = txClient.startShort(); startAllTxAwares(); }
@Path("/transactions/invalid") @GET public void invalidList(HttpRequest request, HttpResponder responder, @QueryParam("limit") @DefaultValue("-1") int limit) { Transaction tx = txClient.startShort(); txClient.abort(tx); long[] invalids = tx.getInvalids(); if (limit == -1) { responder.sendJson(HttpResponseStatus.OK, GSON.toJson(invalids)); return; } responder.sendJson(HttpResponseStatus.OK, GSON.toJson(Arrays.copyOf(invalids, Math.min(limit, invalids.length)))); }
@Path("/transactions/invalid") @GET public void invalidList(HttpRequest request, HttpResponder responder, @QueryParam("limit") @DefaultValue("-1") int limit) { Transaction tx = txClient.startShort(); txClient.abort(tx); long[] invalids = tx.getInvalids(); if (limit == -1) { responder.sendJson(HttpResponseStatus.OK, GSON.toJson(invalids)); return; } responder.sendJson(HttpResponseStatus.OK, GSON.toJson(Arrays.copyOf(invalids, Math.min(limit, invalids.length)))); }