All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.sap.cds.services.impl.transaction.LocalTransactionManager Maven / Gradle / Ivy

There is a newer version: 3.2.0
Show newest version
/**************************************************************************
 * (C) 2019-2024 SAP SE or an SAP affiliate company. All rights reserved. *
 **************************************************************************/
package com.sap.cds.services.impl.transaction;

import com.sap.cds.services.transaction.TransactionManager;
import com.sap.cds.transaction.spi.ContainerTransactionManager;

// adapting the cds4j default transaction manager
public class LocalTransactionManager implements TransactionManager {

	private final ContainerTransactionManager cds4jTxMgr;
	private final String name;

	public LocalTransactionManager(String name, ContainerTransactionManager cds4jTxMgr) {
		this.name = name;
		this.cds4jTxMgr = cds4jTxMgr;
	}

	@Override
	public String getName() {
		return name;
	}

	@Override
	public boolean isActive() {
		return cds4jTxMgr.isActive();
	}

	@Override
	public void begin() {
		cds4jTxMgr.begin();
	}

	@Override
	public void commit() {
		cds4jTxMgr.commit();
	}

	@Override
	public void rollback() {
		cds4jTxMgr.rollback();
	}

	@Override
	public boolean isRollbackOnly() {
		return cds4jTxMgr.isRollbackOnly();
	}

	@Override
	public void setRollbackOnly() {
		cds4jTxMgr.setRollbackOnly();
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy