Transaction Manager Lookup - lifted off from Hibernate
| import javax.transaction.TransactionManager;
|
| import org.apache.commons.logging.Log;
| import org.apache.commons.logging.LogFactory;
| import org.jboss.cache.TransactionManagerLookup;
|
| import
com.esri.infoservices.j2ee.jbosscache.exceptions.InvalidArgumentException;
|
| public class WASTransactionManagerLookup implements
TransactionManagerLookup {
| private static final Log logger = LogFactory
| .getLog(WASTransactionManagerLookup.class);
|
| private int version;
|
| public TransactionManager getTransactionManager() throws Exception {
| try {
| Class clazz;
| try {
| clazz = Class
|
.forName("com.ibm.ws.Transaction.TransactionManagerFactory");
| version = 5;
| logger.info("WebSphere 5.1");
| } catch (Exception e) {
| try {
| clazz = Class
|
.forName("com.ibm.ejs.jts.jta.TransactionManagerFactory");
| version = 5;
| logger.info("WebSphere 5.0");
| } catch (Exception e2) {
| clazz =
Class.forName("com.ibm.ejs.jts.jta.JTSXA");
| version = 4;
| logger.info("WebSphere 4");
| }
| }
|
| return (TransactionManager) clazz.getMethod(
| "getTransactionManager",
null).invoke(null, null);
| } catch (Exception e) {
| throw new InvalidArgumentException(
| "Could not obtain WebSphere JTSXA
instance", e);
| }
| }
|
| }
|
View the original post :
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3880842#3880842
Reply to the post :
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3880842
-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games. How far can you shotput
a projector? How fast can you ride your desk chair down the office luge track?
If you want to score the big prize, get to know the little guy.
Play to win an NEC 61" plasma display: http://www.necitguy.com/?r=20
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user