@Override public TTransaction startShortTimeout(int timeout) throws TException { return TransactionConverterUtils.wrap(txManager.startShort(timeout)); }
@Override public TTransaction startShort() throws TException { return TransactionConverterUtils.wrap(txManager.startShort()); }
public void abort(Transaction tx) throws TException { try { client.abortTx(TransactionConverterUtils.wrap(tx)); } catch (TException e) { isValid.set(false); throw e; } }
@Override public TTransaction startLong() throws TException { return TransactionConverterUtils.wrap(txManager.startLong()); }
@Override public TTransaction startLongClientId(String clientId) throws TException { try { return TransactionConverterUtils.wrap(txManager.startLong(clientId)); } catch (IllegalArgumentException ex) { throw new TGenericException(ex.getMessage(), ex.getClass().getName()); } }
@Override public TTransaction startShortClientId(String clientId) throws TException { try { return TransactionConverterUtils.wrap(txManager.startShort(clientId)); } catch (IllegalArgumentException ex) { throw new TGenericException(ex.getMessage(), ex.getClass().getName()); } }
@Override public TTransaction startShortWithTimeout(int timeout) throws TException { try { return TransactionConverterUtils.wrap(txManager.startShort(timeout)); } catch (IllegalArgumentException e) { throw new TGenericException(e.getMessage(), e.getClass().getName()); } }
@Override public TTransaction startShortWithClientIdAndTimeOut(String clientId, int timeout) throws TException { try { return TransactionConverterUtils.wrap(txManager.startShort(clientId, timeout)); } catch (IllegalArgumentException ex) { throw new TGenericException(ex.getMessage(), ex.getClass().getName()); } }
public byte[] encode(Transaction tx) throws IOException { TTransaction thriftTx = TransactionConverterUtils.wrap(tx); TSerializer serializer = new TSerializer(); try { return serializer.serialize(thriftTx); } catch (TException te) { throw new IOException(te); } }
public Transaction checkpoint(Transaction tx) throws TException { try { return TransactionConverterUtils.unwrap(client.checkpoint(TransactionConverterUtils.wrap(tx))); } catch (TException e) { isValid.set(false); throw e; } }
@Override public TTransaction checkpoint(TTransaction originalTx) throws TException { try { return TransactionConverterUtils.wrap( txManager.checkpoint(TransactionConverterUtils.unwrap(originalTx))); } catch (TransactionNotInProgressException e) { throw new TTransactionNotInProgressException(e.getMessage()); } }