Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » Custom commit() for Transaction
Custom commit() for Transaction [message #59333] Thu, 26 October 2006 05:44 Go to next message
Eclipse UserFriend
Originally posted by: hocnt.cybersoft-vn.com

Hi all,

In the the org.eclipse.emf.transaction.impl.TransactionImpl class: in
the commit(), it will perform a live validation. If there is error => it
will automatically rollback the transaction (TransactionImpl.class, line
313 -> line 324). This class is used by TransactionalEditingDomainImpl,
see TransactionalEditingDomainImpl.class, line 348 -> 355.

I don't know how to do not to rollback the transaction in case of error.

Do you have any idea?

Regards,
Hoc
Re: Custom commit() for Transaction [message #59385 is a reply to message #59333] Thu, 26 October 2006 21:02 Go to previous message
Eclipse UserFriend
Originally posted by: cdamus.ca.ibm.com

Hi, Hoc,

If you want to run a transaction without validating, all you need to do is
to put the Transaction.OPTION_NO_VALIDATION (with value Boolean.TRUE) in
the options map when you create the transaction, either via

- TransactionalCommandStack.execute(Command, Map), or
- AbstractEMFOperation(TransactionalEditingDomain, String, Map)

If what you want is to perform validation, have the EMFT Validation
component send around the validation event with an ERROR status, and commit
anyway, then you would need to subclass the TransactionalEditingDomainImpl
and override its implementation of the precommit(InternalTransaction)
method such that it will not roll back the transaction.

However, this would violate the Transaction contract and would definitely
surprise validation listeners, that receive ERROR statuses and expect that
the transaction is rolled back as a result. Of course, this may not be a
concern in your application, depending on how open or closed it is to
integration with other components ...

HTH,

Christian


Hoc Nguyen wrote:

> Hi all,
>
> In the the org.eclipse.emf.transaction.impl.TransactionImpl class: in
> the commit(), it will perform a live validation. If there is error => it
> will automatically rollback the transaction (TransactionImpl.class, line
> 313 -> line 324). This class is used by TransactionalEditingDomainImpl,
> see TransactionalEditingDomainImpl.class, line 348 -> 355.
>
> I don't know how to do not to rollback the transaction in case of error.
>
> Do you have any idea?
>
> Regards,
> Hoc
Re: Custom commit() for Transaction [message #594863 is a reply to message #59333] Thu, 26 October 2006 21:02 Go to previous message
Eclipse UserFriend
Originally posted by: cdamus.ca.ibm.com

Hi, Hoc,

If you want to run a transaction without validating, all you need to do is
to put the Transaction.OPTION_NO_VALIDATION (with value Boolean.TRUE) in
the options map when you create the transaction, either via

- TransactionalCommandStack.execute(Command, Map), or
- AbstractEMFOperation(TransactionalEditingDomain, String, Map)

If what you want is to perform validation, have the EMFT Validation
component send around the validation event with an ERROR status, and commit
anyway, then you would need to subclass the TransactionalEditingDomainImpl
and override its implementation of the precommit(InternalTransaction)
method such that it will not roll back the transaction.

However, this would violate the Transaction contract and would definitely
surprise validation listeners, that receive ERROR statuses and expect that
the transaction is rolled back as a result. Of course, this may not be a
concern in your application, depending on how open or closed it is to
integration with other components ...

HTH,

Christian


Hoc Nguyen wrote:

> Hi all,
>
> In the the org.eclipse.emf.transaction.impl.TransactionImpl class: in
> the commit(), it will perform a live validation. If there is error => it
> will automatically rollback the transaction (TransactionImpl.class, line
> 313 -> line 324). This class is used by TransactionalEditingDomainImpl,
> see TransactionalEditingDomainImpl.class, line 348 -> 355.
>
> I don't know how to do not to rollback the transaction in case of error.
>
> Do you have any idea?
>
> Regards,
> Hoc
Previous Topic:OCL expressions in Rose models
Next Topic:[Announce] Effective use of the Eclipse Modeling Framework
Goto Forum:
  


Current Time: Wed Jul 24 15:35:46 GMT 2024

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

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

Back to the top