Created
February 2, 2017 09:49
-
-
Save mkuehle/fc8ab57bb98de3587fe1a1115a80f552 to your computer and use it in GitHub Desktop.
REST Resource mit @TransactionTimeout Annotation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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