Hi Joerg, ok, I have to confess I am not allto versed with all the JAX RS annotations. After I wrote this code I saw a JAX RS example that had "Transactional" in it and I was thinking "Hm, I probably should use that instead of creating that Transaction object manually". :-)
Best regards Robert Am 16.09.2016 um 18:10 schrieb Jörg Richter: > Hi Robert, > > in your updateEditablePerson() resource method you create a transaction: > > @PUT > @Path("...") > public void updateEditablePerson(...) { > DeepaMehtaTransaction tx = dm4.beginTx(); > try { > ... > tx.success(); > } finally { > tx.finish(); > } > } > > In a JAX-RS resource method you're not required to create a transaction > manually. > Instead you can rely on DM's @Transactional annotation: > > import de.deepamehta.core.service.Transactional; > > @PUT > @Path("...") > @Transactional > public void updateEditablePerson(...) { > ... > } > > This wraps the entire request processing in a transaction. > > There are rare cases in DM when you're required to create a transaction > manually. > > Cheers, > Jörg > > > -- Robert Schuster freiberuflicher Softwareingenieur RS01 - IT-Systemanalyse und -entwicklung Robert Schuster Brückenstraße 4 • 12439 Berlin +49 157 798 00 310 robert.schuster.r...@gmail.com
-- devel mailing list devel@lists.deepamehta.de http://lists.deepamehta.de/mailman/listinfo/devel-lists.deepamehta.de