Skip to content

Instantly share code, notes, and snippets.

@wolfc
Created February 4, 2012 17:20
Show Gist options
  • Save wolfc/1739016 to your computer and use it in GitHub Desktop.
Save wolfc/1739016 to your computer and use it in GitHub Desktop.
import javax.annotation.Resource;
import javax.ejb.SessionContext;
import javax.ejb.Stateless;
@Stateless
public class MyBean {
@Resource
private SessionContext ctx;
public void doSomething() {
ctx.getUserTransaction().begin();
ctx.getUserTransaction().commit();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment