Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [EMF][Teneo][Transaction] what's the best way to combine them...
[EMF][Teneo][Transaction] what's the best way to combine them... [message #834489] Mon, 02 April 2012 02:21 Go to next message
Simon Chen is currently offline Simon ChenFriend
Messages: 13
Registered: July 2009
Junior Member
I am Hoping to use EMF transaction to ensure data integrity, and help rollback in case certain operations violate my data model.

At the same time, I want to use Teneo to persist the my model data to a backend db.

Actually, when I save data via Teneo, it does some validation too. Should I simply rely on that?

Or should I have some kind of nested transaction?

Outer-trans:
Change model data;
Validate or roll back;
Inner trans:
Save to Teneo;
Roll back outer in case of inner (db) failure.


I am probably deeply confused about these concepts... What's the best solution here? How can I make sure my db and my model are in-sync, as well as model integrity?

Thanks.
-Simon
Re: [EMF][Teneo][Transaction] what's the best way to combine them... [message #834582 is a reply to message #834489] Mon, 02 April 2012 05:52 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Simon,
I am sorry, I have no experience with EMF transaction, so I can't give a sensible reply. Teneo and EMF Transaction are
not used together afaik, most of the time people rely on Teneo to do the transaction and validation. If a save fails the
error is displayed and the user can edit the invalid data to bring it to a valid state.

But your nested transaction seems worth a try, have you tried it?

gr. Martin

On 04/02/2012 04:21 AM, Simon Chen wrote:
> I am Hoping to use EMF transaction to ensure data integrity, and help rollback in case certain operations violate my
> data model.
> At the same time, I want to use Teneo to persist the my model data to a backend db.
>
> Actually, when I save data via Teneo, it does some validation too. Should I simply rely on that?
>
> Or should I have some kind of nested transaction?
>
> Outer-trans:
> Change model data;
> Validate or roll back;
> Inner trans:
> Save to Teneo;
> Roll back outer in case of inner (db) failure.
>
>
> I am probably deeply confused about these concepts... What's the best solution here? How can I make sure my db and my
> model are in-sync, as well as model integrity?
>
> Thanks.
> -Simon


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@xxxxxxxx - mtaal@xxxxxxxx
Web: www.springsite.com - www.elver.org
Re: [EMF][Teneo][Transaction] what's the best way to combine them... [message #834858 is a reply to message #834582] Mon, 02 April 2012 13:40 Go to previous messageGo to next message
Simon Chen is currently offline Simon ChenFriend
Messages: 13
Registered: July 2009
Junior Member
Thanks, Martin...

No, I haven't tried the nested transaction, but I plan to.

My feeling is that manual rollback isn't convenient enough, especially if a transaction touches many objects.

I was hoping there is a way to use Teneo to directly "reload" from the DB, thus discard the changes made to the model. This is more expensive than rollback locally using EMF transaction, but seems easier to do with Teneo... Not sure which method to use though, still experimenting...

-Simon
Re: [EMF][Teneo][Transaction] what's the best way to combine them... [message #834902 is a reply to message #834858] Mon, 02 April 2012 14:34 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Simon,
The hibernate session has a refresh method which reloads from the db. But as you say it is quite expensive to do that
for many objects.

gr. Martin

On 04/02/2012 03:40 PM, Simon Chen wrote:
> Thanks, Martin...
>
> No, I haven't tried the nested transaction, but I plan to.
>
> My feeling is that manual rollback isn't convenient enough, especially if a transaction touches many objects.
>
> I was hoping there is a way to use Teneo to directly "reload" from the DB, thus discard the changes made to the model.
> This is more expensive than rollback locally using EMF transaction, but seems easier to do with Teneo... Not sure which
> method to use though, still experimenting...
>
> -Simon


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@xxxxxxxx - mtaal@xxxxxxxx
Web: www.springsite.com - www.elver.org
Previous Topic:CheckboxTreeViewer data binding with EMF
Next Topic:EMF Validation
Goto Forum:
  


Current Time: Sat Apr 27 03:56:54 GMT 2024

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

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

Back to the top