Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [CDO] Locking while editor is open to reduce possibilities of conflict
[CDO] Locking while editor is open to reduce possibilities of conflict [message #1184468] Wed, 13 November 2013 13:21 Go to next message
Leonid Ripeynih is currently offline Leonid RipeynihFriend
Messages: 150
Registered: February 2012
Senior Member
Hi there!

I'd like to lock resources (acqure write lock) to resources in repository when editor (for resource) is opened, and release it when it's disposed. All to prevent concurrent modification of resource between multiple users.

It works fine by now, but here is some questions, just to make sure:
1. Will the lock be released upon session close (when an editor's dispose method is not given possibility to act: computer reboot, kill -9 e.t.c)
2. Is it generally a good practice, and is there other (maybe built-in) methods to achive same functionality?

Many thanks in advance.
Re: [CDO] Locking while editor is open to reduce possibilities of conflict [message #1184484 is a reply to message #1184468] Wed, 13 November 2013 13:40 Go to previous message
Christian W. Damus is currently offline Christian W. DamusFriend
Messages: 1199
Registered: July 2009
Location: Canada
Senior Member

Hi, Leonid,

The server releases all locks held by a session when that session goes
away for any reason. You can try this, yourself, by killing the client
process and then issuing a "cdo locks" command on server's OSGi console.

I don't know whether automatically locking the resource is a good or a
poor practice. It depends on whether it works for your use cases and
it really makes sense to freeze other users out of editing. BTW, how
does the editor present itself when it cannot obtain the locks it
needs? That could present some usability issues ...

I think Eike has been doing a good deal of work on making merge work
better for transaction conflict resolution, which may possibly relieve
your need for locks. Doubtless he can be more helpful.

HTH,

Christian


On 2013-11-13 13:21:34 +0000, Leonid Ripeynih said:

> Hi there!
>
> I'd like to lock resources (acqure write lock) to resources in
> repository when editor (for resource) is opened, and release it when
> it's disposed. All to prevent concurrent modification of resource
> between multiple users.
> It works fine by now, but here is some questions, just to make sure:
> 1. Will the lock be released upon session close (when an editor's
> dispose method is not given possibility to act: computer reboot, kill
> -9 e.t.c)
> 2. Is it generally a good practice, and is there other (maybe built-in)
> methods to achive same functionality?
>
> Many thanks in advance.
Previous Topic:Use of EXSD File
Next Topic:[RESOLVED][CDO] Importing a model with sequential commits
Goto Forum:
  


Current Time: Tue Dec 10 23:42:01 GMT 2019

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

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

Back to the top