org.hibernate.transaction.WebSphereExtendedJTATransactionLookup Maven / Gradle / Ivy
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
* distributed under license by Red Hat Middleware LLC.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
* Lesser General Public License, as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
* for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this distribution; if not, write to:
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
*
*/
package org.hibernate.transaction;
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;
import java.util.Properties;
import javax.naming.NamingException;
import javax.transaction.NotSupportedException;
import javax.transaction.RollbackException;
import javax.transaction.Status;
import javax.transaction.Synchronization;
import javax.transaction.SystemException;
import javax.transaction.Transaction;
import javax.transaction.TransactionManager;
import javax.transaction.xa.XAResource;
import org.hibernate.HibernateException;
import org.hibernate.util.NamingHelper;
/**
* TransactionManagerLookup implementation intended for use with WebSphere
* Application Server (WAS).
*
* WAS, unlike every other app server on the planet, does not allow direct
* access to the JTS TransactionManager. Instead, for common transaction-
* related tasks users must utilize a proprietary API known as
* ExtendedJTATransaction.
*
* Even more unfortunate, the exact TransactionManagerLookup to use inside of
* WAS is highly dependent upon (1) WAS version as well as (2) the WAS
* container in which Hibernate will be utilized.
*
* WebSphereExtendedJTATransactionLookup is reported to work on WAS version 6
* in any of the standard J2EE/JEE component containers.
*
* @author Gavin King
* @author