|
Re: [Teneo] Rollback with a EclipseLinkResourceImpl [message #389754 is a reply to message #389752] |
Mon, 29 June 2009 20:59 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) ![Go to next message Go to next message](theme/Solstice/images/down.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Luzy,
luciano a écrit :
> Hi,
>
> I'm using the EclipseLinkResourceImpl from Teneo together with
> EclipseLink. How do I implement a rollback in such a context?
What do you exactly mean by "implementing a rollback"?
Do you want to make sure that database transactions carried out by
EclipseLinkResourceImpl are rolled back when something goes wrong? Or to
you want to hook in some user-defined additional action upon rollback?
If the first is the case then I've good new for you: rollback is
supported. When you call EclipseLinkResourceImpl#save(Map<?, ?>) the
resource's underlying transaction is committed (and continued
thereafter). Here is the relevant code fragment implemented inside
EclipseLinkResourceImpl#doSave(OutputStream, Map<?, ?>):
// commit but continue transaction
entityManager.getTransaction().commit();
entityManager.getTransaction().begin();
I.e. when the transaction fails, EclipseLink performs a rollback
procedure as if we had called the commit() method on the transaction on
our own.
Stephan
|
|
|
|
Re: [Teneo] Rollback with a EclipseLinkResourceImpl [message #389784 is a reply to message #389756] |
Fri, 03 July 2009 11:26 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
luciano a écrit :
> I meant the first case. What about my changes in the EMF Java objects?
> Do I have to undo the operations by myself?
Yes. Currently their is no automatic link between EclipseLink rollback
operations and undo stacks on EMF editing domains (this could be a
future extension though). So, for the time being it is up to your
application to make sure that changes that have been rolled back in the
database get undone in the EMF model.
Stephan
|
|
|
Powered by
FUDForum. Page generated in 0.04022 seconds