rs.data.hibernate.util.JOTMJtaPlatform Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of data-hibernate Show documentation
Show all versions of data-hibernate Show documentation
Hibernate extension for Data Access classes
/**
*
*/
package rs.data.hibernate.util;
import javax.transaction.TransactionManager;
import javax.transaction.UserTransaction;
import org.hibernate.HibernateException;
import org.hibernate.service.jta.platform.internal.AbstractJtaPlatform;
import rs.data.JotmSupport;
/**
* Extends the standard JTA implementation by getting the TX
* from the TX manager.
* @author ralph
*
*/
public class JOTMJtaPlatform extends AbstractJtaPlatform {
/**
* Serial UID.
*/
private static final long serialVersionUID = 1L;
/**
* Constructor.
*/
public JOTMJtaPlatform() {
}
/**
* {@inheritDoc}
*/
@Override
protected TransactionManager locateTransactionManager() {
return JotmSupport.getTransactionManager();
}
/**
* {@inheritDoc}
*/
@Override
protected UserTransaction locateUserTransaction() {
UserTransaction rc = JotmSupport.getUserTransaction();
if (rc == null) throw new HibernateException("No user transaction started");
return rc;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy