/** * Start a short transaction with a given timeout. * @param timeoutInSeconds the time out period in seconds. */ public Transaction startShort(int timeoutInSeconds) { return startShort(DEFAULT_CLIENTID, timeoutInSeconds); }
/** * Start a short transaction with the default timeout. */ public Transaction startShort() { return startShort(defaultTimeout); }
/** * Start a short transaction with a client id and default timeout. * @param clientId id of the client requesting a transaction. */ public Transaction startShort(String clientId) { return startShort(clientId, defaultTimeout); }
@Override public Transaction startShort() { return txManager.startShort(); }
@Override public Transaction startShort(int timeout) { return txManager.startShort(timeout); }
@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()); }
@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()); } }
@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()); } }
try { Transaction tx = txManager.startShort(); txManager.abort(tx);