class ResourcelessTransactionManager extends AbstractPlatformTransactionManager {

	@Override
	protected void doBegin(Object transaction, TransactionDefinition definition) throws TransactionException {
		((ResourcelessTransaction) transaction).begin();
	}

	@Override
	protected void doCommit(DefaultTransactionStatus status) throws TransactionException {
		if (logger.isDebugEnabled()) {
			logger.debug("Committing resourceless transaction on [" + status.getTransaction() + "]");
		}
	}

	@Override
	protected Object doGetTransaction() throws TransactionException {<FILL_FUNCTION_BODY>}

	@Override
	protected void doRollback(DefaultTransactionStatus status) throws TransactionException {
		if (logger.isDebugEnabled()) {
			logger.debug("Rolling back resourceless transaction on [" + status.getTransaction() + "]");
		}
	}

	@Override
	protected boolean isExistingTransaction(Object transaction) throws TransactionException {
		if (TransactionSynchronizationManager.hasResource(this)) {
			List<?> stack = (List<?>) TransactionSynchronizationManager.getResource(this);
			return stack.size() > 1;
		}
		return ((ResourcelessTransaction) transaction).isActive();
	}

	@Override
	protected void doSetRollbackOnly(DefaultTransactionStatus status) throws TransactionException {
	}

	@Override
	protected void doCleanupAfterCompletion(Object transaction) {
		List<?> resources = (List<?>) TransactionSynchronizationManager.getResource(this);
		resources.clear();
		TransactionSynchronizationManager.unbindResource(this);
		((ResourcelessTransaction) transaction).clear();
	}

	private static class ResourcelessTransaction {

		private boolean active = false;

		public boolean isActive() {
			return active;
		}

		public void begin() {
			active = true;
		}

		public void clear() {
			active = false;
		}

	}

}

		Object transaction = new ResourcelessTransaction();
		List<Object> resources;
		if (!TransactionSynchronizationManager.hasResource(this)) {
			resources = new ArrayList<>();
			TransactionSynchronizationManager.bindResource(this, resources);
		}
		else {
			@SuppressWarnings("unchecked")
			List<Object> stack = (List<Object>) TransactionSynchronizationManager.getResource(this);
			resources = stack;
		}
		resources.add(transaction);
		return transaction;
	
<methods>public void <init>() ,public final void commit(org.springframework.transaction.TransactionStatus) throws org.springframework.transaction.TransactionException,public final int getDefaultTimeout() ,public final org.springframework.transaction.TransactionStatus getTransaction(org.springframework.transaction.TransactionDefinition) throws org.springframework.transaction.TransactionException,public final Collection<org.springframework.transaction.TransactionExecutionListener> getTransactionExecutionListeners() ,public final int getTransactionSynchronization() ,public final boolean isFailEarlyOnGlobalRollbackOnly() ,public final boolean isGlobalRollbackOnParticipationFailure() ,public final boolean isNestedTransactionAllowed() ,public final boolean isRollbackOnCommitFailure() ,public final boolean isValidateExistingTransaction() ,public final void rollback(org.springframework.transaction.TransactionStatus) throws org.springframework.transaction.TransactionException,public final void setDefaultTimeout(int) ,public final void setFailEarlyOnGlobalRollbackOnly(boolean) ,public final void setGlobalRollbackOnParticipationFailure(boolean) ,public final void setNestedTransactionAllowed(boolean) ,public final void setRollbackOnCommitFailure(boolean) ,public final void setTransactionExecutionListeners(Collection<org.springframework.transaction.TransactionExecutionListener>) ,public final void setTransactionSynchronization(int) ,public final void setTransactionSynchronizationName(java.lang.String) ,public final void setValidateExistingTransaction(boolean) <variables>public static final int SYNCHRONIZATION_ALWAYS,public static final int SYNCHRONIZATION_NEVER,public static final int SYNCHRONIZATION_ON_ACTUAL_TRANSACTION,static final Map<java.lang.String,java.lang.Integer> constants,private int defaultTimeout,private boolean failEarlyOnGlobalRollbackOnly,private boolean globalRollbackOnParticipationFailure,protected transient org.apache.commons.logging.Log logger,private boolean nestedTransactionAllowed,private boolean rollbackOnCommitFailure,private Collection<org.springframework.transaction.TransactionExecutionListener> transactionExecutionListeners,private int transactionSynchronization,private boolean validateExistingTransaction