|
Re: CDO lock/unlock model event [message #1006597 is a reply to message #1006414] |
Fri, 01 February 2013 06:44 |
|
Am 31.01.2013 15:23, schrieb Huang Karelun:
> 1.I used CDO for connecting between mult-clients and server.
> 2.In one client, I used this code CDOUtil.getCDOObject((EObject)object).cdoWriteLock().lock(); to lock one model which
> defined by EMF.
Have you regenerated your model for CDO? If so you would just call object.cdoWriteLock().lock();
> then I can catch the CDOSessionLocksChangedEvent by listening the CDOSession listeners in the current client, which
> it's correctly.
> 3.But In other clients, I can't catch the CDOSessionLocksChangedEvent with the same method. so can you tell me how to
> catch it in other clients, and which it's important for me!
You need to enable this functionality via CDOCommonSession.Options.setLockNotificationMode(LockNotificationMode).
> 4.Lastly, My main meaning is: one client locks/unlocks one model, the other clients also should catch the lock/unlock
> event.
Hmm, how is this different from your question 3?
Cheers
/Eike
----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
> 5.By the way, the version of CDO what I used is 4.1.
> Thank for your answers!
Cheers
/Eike
----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
|
|
|
Re: CDO lock/unlock model event [message #1007030 is a reply to message #1006597] |
Mon, 04 February 2013 06:56 |
Huang Karelun Messages: 4 Registered: January 2013 |
Junior Member |
|
|
Maybe you misunderstand my description or I wrote it with no clearly. Now I will describe it again:
Firstly, what I've been finished with CDO successful like these:
1). Can connect between multi-clients and server.
2).In one client, use this code CDOUtil.getcdoObject((EObject)object).cdoWriteLock().lock(); ,I can lock one model, and can also listen the CDOSessionLocksChangedEvent in the current client by CDOSession.
Secondly, Now This is the problem:
1). When one client locks one model, other clients can not listen to the CDOSessionLocksChangedEvent, so they don't know whether any one model has been locked or not.
Thirdly, some extra info:
1). The CDO version is 4.1.
2). I've used your mentioned method:transaction.getSession().options().setLockNotificationMode(LockNotificationMode.ALWAYS); , but its still can not solve my problem.
|
|
|
Re: CDO lock/unlock model event [message #1007034 is a reply to message #1007030] |
Mon, 04 February 2013 07:48 |
|
Am 04.02.2013 07:56, schrieb Huang Karelun:
> Maybe you misunderstand my description or I wrote it with no clearly. Now I will describe it again:
> Firstly, what I've been finished with CDO successful like these:
> 1). Can connect between multi-clients and server.
> 2).In one client, use this code CDOUtil.getcdoObject((EObject)object).cdoWriteLock().lock();,I can lock one model, and
> can also listen the CDOSessionLocksChangedEvent in the current client by CDOSession.
>
> Secondly, Now This is the problem:
> 1). When one client locks one model, other clients can not listen to the CDOSessionLocksChangedEvent, so they don't
> know whether any one model has been locked or not.
>
> Thirdly, some extra info:
> 1). The CDO version is 4.1.
> 2). I've used your mentioned
> method:transaction.getSession().options().setLockNotificationMode(LockNotificationMode.ALWAYS);, but its still can not
> solve my problem.
So, you say that you set LockNotificationMode.ALWAYS in the *receiving* client and add a listener to the *receiving*
client and then your listener does not receive any CDOSessionLocksChangedEvents?
Have you waited long enough for the receiving client to asynchronously process potential events? In test cases it's all
too easy to place an assertion into the test logic without a timeout.
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
|
|
|
|
Powered by
FUDForum. Page generated in 0.01907 seconds