Skip to content

Instantly share code, notes, and snippets.

@maxant
Last active August 29, 2015 14:25
Show Gist options
  • Save maxant/03a4f6545640e8d66e1c to your computer and use it in GitHub Desktop.
Save maxant/03a4f6545640e8d66e1c to your computer and use it in GitHub Desktop.
@Resource UserTransaction ut;
@Override
protected void doGet(HttpServletRequest request, final HttpServletResponse response) throws ServletException, IOException {
ut.begin();
...
CompletableFuture<String> cf = new CompletableFuture<>();
service.foo(cf, pw);
...
cf.whenCompleteAsync((s, t)->{
...
ut.commit(); // => exception: "BaseTransaction.commit - ARJUNA016074: no transaction!"
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment