Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » Custom commit() for Transaction 
| Custom commit() for Transaction [message #59333] | 
Thu, 26 October 2006 01:44   | 
 
Eclipse User  | 
 | 
 | 
   | 
 
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 17:02   | 
 
Eclipse User  | 
 | 
 | 
   | 
 
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 17:02   | 
 
Eclipse User  | 
 | 
 | 
   | 
 
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
 |  
 |  
  |   
Goto Forum:
 
 Current Time: Mon Nov 03 22:05:38 EST 2025 
 Powered by  FUDForum. Page generated in 0.04452 seconds  
 |