/** * This implementation exposes the SavepointManager interface * of the underlying transaction object, if any. */ @Override protected SavepointManager getSavepointManager() { if (!isTransactionSavepointManager()) { throw new NestedTransactionNotSupportedException( "Transaction object [" + getTransaction() + "] does not support savepoints"); } return (SavepointManager) getTransaction(); }
public void setTransactionData(Object transactionData) { this.transactionData = transactionData; this.entityManagerHolder.setTransactionActive(true); if (transactionData instanceof SavepointManager) { this.entityManagerHolder.setSavepointManager((SavepointManager) transactionData); } }
private SavepointManager getSavepointManager() { if (!isSavepointAllowed()) { throw new NestedTransactionNotSupportedException( "Transaction manager does not allow nested transactions"); } SavepointManager savepointManager = getEntityManagerHolder().getSavepointManager(); if (savepointManager == null) { throw new NestedTransactionNotSupportedException( "JpaDialect does not support savepoints - check your JPA provider's capabilities"); } return savepointManager; }
protected void setSavepointManager(SavepointManager savepointManager) { this.savepointManager = savepointManager; }
protected SavepointManager getSavepointManager() { return this.savepointManager; }
/** * Return whether the underlying transaction implements the * SavepointManager interface. * @see #getTransaction * @see org.springframework.transaction.SavepointManager */ public boolean isTransactionSavepointManager() { return (getTransaction() instanceof SavepointManager); }
/** * Return a SavepointManager for the underlying transaction, if possible. * <p>Default implementation always throws a NestedTransactionNotSupportedException. * @throws org.springframework.transaction.NestedTransactionNotSupportedException * if the underlying transaction does not support savepoints */ protected SavepointManager getSavepointManager() { throw new NestedTransactionNotSupportedException("This transaction does not support savepoints"); }