Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » [Teneo] Rollback with a EclipseLinkResourceImpl
[Teneo] Rollback with a EclipseLinkResourceImpl [message #389752] Sun, 28 June 2009 18:02 Go to next message
luciano is currently offline lucianoFriend
Messages: 16
Registered: July 2009
Junior Member
Hi,

I'm using the EclipseLinkResourceImpl from Teneo together with
EclipseLink. How do I implement a rollback in such a context?

Thanks,
Luzi
Re: [Teneo] Rollback with a EclipseLinkResourceImpl [message #389754 is a reply to message #389752] Mon, 29 June 2009 20:59 Go to previous messageGo to next message
Stephan Eberle is currently offline Stephan EberleFriend
Messages: 35
Registered: July 2009
Member

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 #389756 is a reply to message #389754] Tue, 30 June 2009 19:16 Go to previous messageGo to next message
luciano is currently offline lucianoFriend
Messages: 16
Registered: July 2009
Junior Member
I meant the first case. What about my changes in the EMF Java objects? Do
I have to undo the operations by myself?

Thanks again
Re: [Teneo] Rollback with a EclipseLinkResourceImpl [message #389784 is a reply to message #389756] Fri, 03 July 2009 11:26 Go to previous message
Stephan Eberle is currently offline Stephan EberleFriend
Messages: 35
Registered: July 2009
Member

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
Previous Topic:indirect resultlist
Next Topic:@manytomany and "Null primary key encountered in unit of work clone"
Goto Forum:
  


Current Time: Fri Dec 19 03:14:43 GMT 2014

Powered by FUDForum. Page generated in 0.02138 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software