/** * @param entries Entries to lock or {@code null} if use default {@link IgniteInternalTx#optimisticLockEntries()}. * @throws IgniteCheckedException If prepare step failed. */ public void userPrepare(@Nullable Collection<IgniteTxEntry> entries) throws IgniteCheckedException { if (state() != PREPARING) { if (remainingTime() == -1) throw new IgniteTxTimeoutCheckedException("Transaction timed out: " + this); TransactionState state = state(); setRollbackOnly(); throw new IgniteCheckedException("Invalid transaction state for prepare [state=" + state + ", tx=" + this + ']'); } checkValid(); try { cctx.tm().prepareTx(this, entries); calculatePartitionUpdateCounters(); } catch (IgniteCheckedException e) { throw e; } catch (Throwable e) { setRollbackOnly(); if (e instanceof Error) throw e; throw new IgniteCheckedException("Transaction validation produced a runtime exception: " + this, e); } }
/** * @param entries Entries to lock or {@code null} if use default {@link IgniteInternalTx#optimisticLockEntries()}. * @throws IgniteCheckedException If prepare step failed. */ @SuppressWarnings({"CatchGenericClass"}) public void userPrepare(@Nullable Collection<IgniteTxEntry> entries) throws IgniteCheckedException { if (state() != PREPARING) { if (remainingTime() == -1) throw new IgniteTxTimeoutCheckedException("Transaction timed out: " + this); TransactionState state = state(); setRollbackOnly(); throw new IgniteCheckedException("Invalid transaction state for prepare [state=" + state + ", tx=" + this + ']'); } checkValid(); try { cctx.tm().prepareTx(this, entries); calculatePartitionUpdateCounters(); } catch (IgniteCheckedException e) { throw e; } catch (Throwable e) { setRollbackOnly(); if (e instanceof Error) throw e; throw new IgniteCheckedException("Transaction validation produced a runtime exception: " + this, e); } }