Skip to content

Instantly share code, notes, and snippets.

@mkuehle
Created February 2, 2017 09:49
Show Gist options
  • Save mkuehle/fc8ab57bb98de3587fe1a1115a80f552 to your computer and use it in GitHub Desktop.
Save mkuehle/fc8ab57bb98de3587fe1a1115a80f552 to your computer and use it in GitHub Desktop.
REST Resource mit @TransactionTimeout Annotation
@Stateless
@Path("/my-rest-endpoint")
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
public class MyResourceResource {
@Inject
MyImporter myImporter;
...
@GET
@Path("/import-large-data")
@TransactionTimeout(value = 10, unit = TimeUnit.MINUTES)
public void importLargeData() throws Exception {
myImporter.startImport();
}
...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment