org.springframework.transaction.SavepointManager Java Examples

The following examples show how to use org.springframework.transaction.SavepointManager. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: DefaultTransactionStatus.java    From spring4-understanding with Apache License 2.0 5 votes vote down vote up
/**
 * 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();
}
 
Example #2
Source File: JpaTransactionManager.java    From spring-analysis-note with MIT License 5 votes vote down vote up
public void setTransactionData(@Nullable Object transactionData) {
	this.transactionData = transactionData;
	getEntityManagerHolder().setTransactionActive(true);
	if (transactionData instanceof SavepointManager) {
		getEntityManagerHolder().setSavepointManager((SavepointManager) transactionData);
	}
}
 
Example #3
Source File: JpaTransactionManager.java    From spring-analysis-note with MIT License 5 votes vote down vote up
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;
}
 
Example #4
Source File: DefaultTransactionStatus.java    From spring-analysis-note with MIT License 5 votes vote down vote up
/**
 * This implementation exposes the {@link SavepointManager} interface
 * of the underlying transaction object, if any.
 * @throws NestedTransactionNotSupportedException if savepoints are not supported
 * @see #isTransactionSavepointManager()
 */
@Override
protected SavepointManager getSavepointManager() {
	Object transaction = this.transaction;
	if (!(transaction instanceof SavepointManager)) {
		throw new NestedTransactionNotSupportedException(
				"Transaction object [" + this.transaction + "] does not support savepoints");
	}
	return (SavepointManager) transaction;
}
 
Example #5
Source File: JpaTransactionManager.java    From spring4-understanding with Apache License 2.0 5 votes vote down vote up
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;
}
 
Example #6
Source File: JpaTransactionManager.java    From spring4-understanding with Apache License 2.0 5 votes vote down vote up
public void setTransactionData(Object transactionData) {
	this.transactionData = transactionData;
	this.entityManagerHolder.setTransactionActive(true);
	if (transactionData instanceof SavepointManager) {
		this.entityManagerHolder.setSavepointManager((SavepointManager) transactionData);
	}
}
 
Example #7
Source File: JpaTransactionManager.java    From java-technology-stack with MIT License 5 votes vote down vote up
public void setTransactionData(@Nullable Object transactionData) {
	this.transactionData = transactionData;
	getEntityManagerHolder().setTransactionActive(true);
	if (transactionData instanceof SavepointManager) {
		getEntityManagerHolder().setSavepointManager((SavepointManager) transactionData);
	}
}
 
Example #8
Source File: JpaTransactionManager.java    From java-technology-stack with MIT License 5 votes vote down vote up
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;
}
 
Example #9
Source File: DefaultTransactionStatus.java    From java-technology-stack with MIT License 5 votes vote down vote up
/**
 * This implementation exposes the {@link SavepointManager} interface
 * of the underlying transaction object, if any.
 * @throws NestedTransactionNotSupportedException if savepoints are not supported
 * @see #isTransactionSavepointManager()
 */
@Override
protected SavepointManager getSavepointManager() {
	Object transaction = this.transaction;
	if (!(transaction instanceof SavepointManager)) {
		throw new NestedTransactionNotSupportedException(
				"Transaction object [" + this.transaction + "] does not support savepoints");
	}
	return (SavepointManager) transaction;
}
 
Example #10
Source File: JpaTransactionManager.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
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;
}
 
Example #11
Source File: JpaTransactionManager.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
public void setTransactionData(Object transactionData) {
	this.transactionData = transactionData;
	this.entityManagerHolder.setTransactionActive(true);
	if (transactionData instanceof SavepointManager) {
		this.entityManagerHolder.setSavepointManager((SavepointManager) transactionData);
	}
}
 
Example #12
Source File: DefaultTransactionStatus.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
/**
 * 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();
}
 
Example #13
Source File: EntityManagerHolder.java    From lams with GNU General Public License v2.0 4 votes vote down vote up
protected void setSavepointManager(SavepointManager savepointManager) {
	this.savepointManager = savepointManager;
}
 
Example #14
Source File: EntityManagerHolder.java    From spring-analysis-note with MIT License 4 votes vote down vote up
@Nullable
protected SavepointManager getSavepointManager() {
	return this.savepointManager;
}
 
Example #15
Source File: EntityManagerHolder.java    From lams with GNU General Public License v2.0 4 votes vote down vote up
protected SavepointManager getSavepointManager() {
	return this.savepointManager;
}
 
Example #16
Source File: EntityManagerHolder.java    From spring4-understanding with Apache License 2.0 4 votes vote down vote up
protected void setSavepointManager(SavepointManager savepointManager) {
	this.savepointManager = savepointManager;
}
 
Example #17
Source File: EntityManagerHolder.java    From spring4-understanding with Apache License 2.0 4 votes vote down vote up
protected SavepointManager getSavepointManager() {
	return this.savepointManager;
}
 
Example #18
Source File: EntityManagerHolder.java    From java-technology-stack with MIT License 4 votes vote down vote up
@Nullable
protected SavepointManager getSavepointManager() {
	return this.savepointManager;
}
 
Example #19
Source File: EntityManagerHolder.java    From java-technology-stack with MIT License 4 votes vote down vote up
protected void setSavepointManager(@Nullable SavepointManager savepointManager) {
	this.savepointManager = savepointManager;
}
 
Example #20
Source File: EntityManagerHolder.java    From spring-analysis-note with MIT License 4 votes vote down vote up
protected void setSavepointManager(@Nullable SavepointManager savepointManager) {
	this.savepointManager = savepointManager;
}
 
Example #21
Source File: AbstractTransactionStatus.java    From lams with GNU General Public License v2.0 2 votes vote down vote up
/**
 * 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");
}
 
Example #22
Source File: DefaultTransactionStatus.java    From lams with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Return whether the underlying transaction implements the
 * SavepointManager interface.
 * @see #getTransaction
 * @see org.springframework.transaction.SavepointManager
 */
public boolean isTransactionSavepointManager() {
	return (getTransaction() instanceof SavepointManager);
}
 
Example #23
Source File: AbstractTransactionStatus.java    From java-technology-stack with MIT License 2 votes vote down vote up
/**
 * 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");
}
 
Example #24
Source File: DefaultTransactionStatus.java    From java-technology-stack with MIT License 2 votes vote down vote up
/**
 * Return whether the underlying transaction implements the {@link SavepointManager}
 * interface and therefore supports savepoints.
 * @see #getTransaction()
 * @see #getSavepointManager()
 */
public boolean isTransactionSavepointManager() {
	return (this.transaction instanceof SavepointManager);
}
 
Example #25
Source File: AbstractTransactionStatus.java    From spring-analysis-note with MIT License 2 votes vote down vote up
/**
 * 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");
}
 
Example #26
Source File: DefaultTransactionStatus.java    From spring-analysis-note with MIT License 2 votes vote down vote up
/**
 * Return whether the underlying transaction implements the {@link SavepointManager}
 * interface and therefore supports savepoints.
 * @see #getTransaction()
 * @see #getSavepointManager()
 */
public boolean isTransactionSavepointManager() {
	return (this.transaction instanceof SavepointManager);
}
 
Example #27
Source File: DefaultTransactionStatus.java    From spring4-understanding with Apache License 2.0 2 votes vote down vote up
/**
 * Return whether the underlying transaction implements the
 * SavepointManager interface.
 * @see #getTransaction
 * @see org.springframework.transaction.SavepointManager
 */
public boolean isTransactionSavepointManager() {
	return (getTransaction() instanceof SavepointManager);
}
 
Example #28
Source File: AbstractTransactionStatus.java    From spring4-understanding with Apache License 2.0 2 votes vote down vote up
/**
 * 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");
}