Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save milenkovicm/2718084 to your computer and use it in GitHub Desktop.
Save milenkovicm/2718084 to your computer and use it in GitHub Desktop.
JBoss7 Transaction Manager Lookup
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