Created
May 17, 2012 10:47
-
-
Save milenkovicm/2718084 to your computer and use it in GitHub Desktop.
JBoss7 Transaction Manager Lookup
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class JBoss7TransactionManagerLookup implements TransactionManagerLookup { | |
public TransactionManager getTransactionManager() throws Exception { | |
InitialContext ic = new InitialContext(); | |
TransactionManager tm = (TransactionManager) ic.lookup("java:jboss/TransactionManager"); | |
if (tm == null) throw new IllegalStateException("Couldn't find the transaction mamager in JNDI"); | |
return tm; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment