Thanks for your replies.
JimFoye wrote:
I think you've just described the classic "concurrency" problem.
This is indeed a "concurrency" problem.
In my previous project, all my objects were MarshalByRefObj. So there was just one copy of object on the server and everyone was sharing the same copy.
With LLBL Entities, which are marshal by val - it makes copies on client machine.
As entities have no knowledge of server, the scenario with two clients i have mentioned above ends up in 3 different copies of the same entity.
When user1 updates entites on the server, entities on the server are updated with User1's entities. (where user2 is not aware of this change)
Any update form user2 after that simply overwrites changes done by user1 and makes own copy as current.
The thing i dont understand is in case of remoting/marshalbyVal, how do people keep all clients up-to-date?
JimFoye wrote:
As far as firing events, this is not something that you would normally do even in a classic 2-tier client/server environment, let alone multi-tier remoting scenario.
When i was designing my previous project, i came up to the same problem.
The results from Google, Microsoft and books (including Advanced .net remoting by Ingo Ramer), all discussed some kind of implementation for bi-directional channels or implementing client/server on both the sides.
What is the other way of keeping clients in sync?
JimFoye wrote:
Although the next version of SQL Server, I understand, will include some kind of notification scheme that facilitates this.
As far as my understanding (consider me not experienced), we need concurrency resolution at BL level, as we are sharing objects through remoting not the data.
And SQL Server will never know about number of clinets, notification scheme is the second thing.
Walaa wrote:
That's a big question
I thought that eveyone using remoting must have faced the same problem !!
Walaa wrote:
Well you can use the very optimistic approach and let the database handels everything for you, and then you should update clients objects after each save (refetch).
As i have mentioned above, we need resolution at BL/Managers level and need to keep clinets in sync.
Database dont know about number of clients.
Walaa wrote:
You can implement some concurrency control in the manager clases in the remoting server.
That is infact my original quesiton, but still how to keep clients in sync?
Walaa wrote:
Or you can be more strict and implement some locking techniques in the managers classes, thus preventing clients from updating an object that was locked by another client.
Yes, Letting only one user to access one object at a time is always an option.
Any more help guys?
People who are using remoting with LLBL, how they are coping up?
Kapil