Hi,
In this code sample, why is it that it takes 3s for the "OK" response to
get back to the client.
My expectation would be that the response would go back immediately?
@Path("/abc")
@Stateless
public class BasicResource {
@PersistenceContext()
private EntityManager em;
@GET
@Produces(MediaType.TEXT_PLAIN)
public void test(@Suspended final AsyncResponse asyncResponse) {
// Want OK to get to the client immediately
asyncResponse.resume("OK");
try {
// Some long running JDBC transactional stuff to run in JTA
container managed transaction using injected em
// That must commit when done
Thread.sleep(3000);
} catch (Exception e) {
}
}
}
Paul