Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » EMF Validation, RollBack on error
EMF Validation, RollBack on error [message #503225] Fri, 11 December 2009 08:19 Go to next message
Baptiste Mesta is currently offline Baptiste MestaFriend
Messages: 31
Registered: September 2009
Member
Hello,

I'm currently using EMF Validation with Java constraints to validate my model.

I'm using Batch and Live mode but it seems that in Live mode if an EMF transaction break a constraint it's automatically rolled back.

Is there a way to disable this behaviour.

Thank you in advance.


[Updated on: Fri, 11 December 2009 08:20]

Report message to a moderator

Re: EMF Validation, RollBack on error [message #503237 is a reply to message #503225] Fri, 11 December 2009 14:18 Go to previous messageGo to next message
Christian Damus is currently offline Christian DamusFriend
Messages: 1270
Registered: July 2009
Location: Canada
Senior Member

--=-8oeGkpuWeEs5Y+fWp/cx
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

Hi, Baptiste,

That's the whole point of the integration of validation into the
transaction API: transactions that would violate constraints of ERROR
severity are rolled back so that problems don't occur downstream. If a
live constraint doesn't warrant transaction roll-back, then it should at
most be a WARNING severity. Or, perhaps it shouldn't be live but
instead batch.

However, the API does acknowledge that there may be situations where an
application really needs to perform unvalidated model edits. In that
case, you can apply the Transaction::OPTION_UNVALIDATED to your
transaction, via TransactionalCommandStack::execute(Command, Map) or the
AbstractEMFOperation constructor.

HTH,

Christian


On Fri, 2009-12-11 at 09:19 +0100, Baptiste Mesta wrote:

> Hello,
>
> I'm currently using EMF Validation with Java constraints to validate my model.
>
> I'm using Batch and Live mode but it seems that in Live mode if an EMF transaction break a constraint it's automatically rolled back.
>
> Is there a way to disable this behaviour.
>
> Thank you in advance.

--=-8oeGkpuWeEs5Y+fWp/cx
Content-Type: text/html; charset="utf-8"

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
<META NAME="GENERATOR" CONTENT="GtkHTML/3.24.1.1">
</HEAD>
<BODY>
Hi, Baptiste,<BR>
<BR>
That's the whole point of the integration of validation into the transaction API:&nbsp; transactions that would violate constraints of ERROR severity are rolled back so that problems don't occur downstream.&nbsp; If a live constraint doesn't warrant transaction roll-back, then it should at most be a WARNING severity.&nbsp; Or, perhaps it shouldn't be live but instead batch.<BR>
<BR>
However, the API does acknowledge that there may be situations where an application really needs to perform unvalidated model edits.&nbsp; In that case, you can apply the Transaction::OPTION_UNVALIDATED to your transaction, via TransactionalCommandStack::execute(Command, Map) or the AbstractEMFOperation constructor.<BR>
<BR>
HTH,<BR>
<BR>
Christian<BR>
<BR>
<BR>
On Fri, 2009-12-11 at 09:19 +0100, Baptiste Mesta wrote:
<BLOCKQUOTE TYPE=CITE>
<PRE>
Hello,

I'm currently using EMF Validation with Java constraints to validate my model.

I'm using Batch and Live mode but it seems that in Live mode if an EMF transaction break a constraint it's automatically rolled back.

Is there a way to disable this behaviour.

Thank you in advance.
</PRE>
</BLOCKQUOTE>
</BODY>
</HTML>

--=-8oeGkpuWeEs5Y+fWp/cx--
Re: EMF Validation, RollBack on error [message #503483 is a reply to message #503237] Mon, 14 December 2009 07:33 Go to previous message
Baptiste Mesta is currently offline Baptiste MestaFriend
Messages: 31
Registered: September 2009
Member
Thank you for the hint.

I'm in that case, I have disabled live validation for now but i'll try that when needed.


Thanks a lot.


Previous Topic:How to compare dynamic ecore models
Next Topic:Modifying properties view (combo box value)
Goto Forum:
  


Current Time: Thu Apr 25 04:26:00 GMT 2024

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

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

Back to the top