<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
Hi Joerg,<br>
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". :-)<br>
<br>
Best regards<br>
Robert<br>
<br>
<div class="moz-cite-prefix">Am 16.09.2016 um 18:10 schrieb Jörg
Richter:<br>
</div>
<blockquote
cite="mid:14F51954-01B2-4579-9C86-F53B626D063B@deepamehta.de"
type="cite">
<pre wrap="">
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
</pre>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
</blockquote>
<br>
<pre class="moz-signature" cols="72">--
Robert Schuster
freiberuflicher Softwareingenieur
RS01 - IT-Systemanalyse und -entwicklung Robert Schuster
Brückenstraße 4 • 12439 Berlin
+49 157 798 00 310
<a class="moz-txt-link-abbreviated" href="mailto:robert.schuster.rs01@gmail.com">robert.schuster.rs01@gmail.com</a>
</pre>
</body>
</html>