|
Re: DAWN and Synchronous Modeling [message #852126 is a reply to message #852078] |
Sat, 21 April 2012 17:58 |
|
Am 21.04.2012 18:52, schrieb Siva Raj:
> Hi all,
>
> Is DAWN capable of providing Synchronous Communication? I mean, every edit on the models, need to be synchronized
> with all the editors which share the same model.
You can try to play with something like this:
transaction.options().setStaleReferencePolicy(CDOStaleReferencePolicy.PROXY);
transaction.options().setInvalidationPolicy(CDOInvalidationPolicy.RELAXED);
transaction.options().addChangeSubscriptionPolicy(CDOAdapterPolicy.ALL);
transaction.addTransactionHandler(new CDOPostEventTransactionHandler.Default() {
@Override
protected void modifiedObject(CDOTransaction tx, CDOObject object, Notification msg) {
try {
transaction.commit();
} catch (Exception e) {
System.out.println("Commit problem. Conflicts: " + transaction.getConflicts()); //$NON-NLS-1$
transaction.rollback();
}
}
});
Martin may have more ideas...
Cheers
/Eike
----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
Cheers
/Eike
----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
|
|
|
Re: DAWN and Synchronous Modeling [message #852158 is a reply to message #852126] |
Sat, 21 April 2012 18:38 |
Martin Fluegge Messages: 141 Registered: July 2009 |
Senior Member |
|
|
I would do it as Eike supposed, but do not forget to call
IDawnEditingSupport.refresh()
to update the UI.
As this has been asked before, could you file a bugzilla? We could add
switch to the generator to generate a synchronous version.
Cheers,
Martin
Am 21.04.2012 19:58, schrieb Eike Stepper:
> Am 21.04.2012 18:52, schrieb Siva Raj:
>> Hi all,
>>
>> Is DAWN capable of providing Synchronous Communication? I mean, every
>> edit on the models, need to be synchronized with all the editors which
>> share the same model.
> You can try to play with something like this:
>
>
> transaction.options().setStaleReferencePolicy(CDOStaleReferencePolicy.PROXY);
>
>
> transaction.options().setInvalidationPolicy(CDOInvalidationPolicy.RELAXED);
>
> transaction.options().addChangeSubscriptionPolicy(CDOAdapterPolicy.ALL);
> transaction.addTransactionHandler(new
> CDOPostEventTransactionHandler.Default() {
> @Override
> protected void modifiedObject(CDOTransaction tx, CDOObject
> object, Notification msg) {
> try {
> transaction.commit();
> } catch (Exception e) {
> System.out.println("Commit problem. Conflicts: " +
> transaction.getConflicts()); //$NON-NLS-1$
> transaction.rollback();
> }
> }
> });
>
> Martin may have more ideas...
>
> Cheers
> /Eike
>
> ----
> http://www.esc-net.de
> http://thegordian.blogspot.com
> http://twitter.com/eikestepper
>
>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.02854 seconds