Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [CDO] Auto release lock on transaction or session close ?(In case of application crash to avoid having to restart the repository)
[CDO] Auto release lock on transaction or session close ? [message #1263340] Tue, 04 March 2014 11:42 Go to next message
Laurent Le Moux is currently offline Laurent Le MouxFriend
Messages: 184
Registered: September 2011
Senior Member
Hi all,

I use transaction.options().setAutoReleaseLocksEnabled(true) to release locks on commit.

I would like to know if it's possible to also automatically release all locks on transaction or session close ?

In case of application crash, it would help to release locks without having to stop and restart the repository itself (which would disturb other connected users...).

Or is there another and better way to achieve this ?

Kind regards,

Laurent
Re: [CDO] Auto release lock on transaction or session close ? [message #1263564 is a reply to message #1263340] Tue, 04 March 2014 15:48 Go to previous messageGo to next message
Laurent Le Moux is currently offline Laurent Le MouxFriend
Messages: 184
Registered: September 2011
Senior Member
Hi again,

Forget about this question, I found in the CDO / Net4j FAQ that "Locks are automatically released when the view/transaction is closed".
Sorry for the disturbance.

Laurent
Re: [CDO] Auto release lock on transaction or session close ? [message #1276533 is a reply to message #1263564] Mon, 24 March 2014 17:53 Go to previous messageGo to next message
Laurent Le Moux is currently offline Laurent Le MouxFriend
Messages: 184
Registered: September 2011
Senior Member
Hi again,

Sorry to bring this topic back to the top of the list...
If a transaction asks twice for a write lock on a same object (because of a bug of course...), it seems that only one lock is released when the transaction is closed.

Then, to get rid of the remaining and undue lock, the cdo server needs to be restarted which is not very convenient.

I would suggest a CDO enhancement so that, if a second lock is asked by mistake, an exception is thrown for the developper to get notified.

Kind regards,

Laurent
Re: [CDO] Auto release lock on transaction or session close ? [message #1276546 is a reply to message #1276533] Mon, 24 March 2014 18:09 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Am 24.03.2014 18:53, schrieb Laurent Le Moux:
> Hi again,
>
> Sorry to bring this topic back to the top of the list...
> If a transaction asks twice for a write lock on a same object (because of a bug of course...), it seems that only one
> lock is released when the transaction is closed.
>
> Then, to get rid of the remaining and undue lock, the cdo server needs to be restarted which is not very convenient.
>
> I would suggest a CDO enhancement so that, if a second lock is asked by mistake, an exception is thrown for the
> developper to get notified.
I thought that write locks internally have a "lock count", but I have to analyze this in more depth. In no case the
server should have to be restarted. Can you please submit a bugzilla? Maybe you can copy&adjust one of our many test
cases to demo the problem?

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper


Re: [CDO] Auto release lock on transaction or session close ? [message #1277049 is a reply to message #1276546] Tue, 25 March 2014 12:15 Go to previous message
Laurent Le Moux is currently offline Laurent Le MouxFriend
Messages: 184
Registered: September 2011
Senior Member
Hi Eike,

I submitted a bugzilla :
https://bugs.eclipse.org/bugs/show_bug.cgi?id=431107

However, I failed to install org.eclipse.emf.cdo.tests and couldn't add a new case to the LockingManagerTest class...

Regards,

Laurent
Previous Topic:GenModel - Java 8 support
Next Topic:Duplicated EReferences in a ecore Model
Goto Forum:
  


Current Time: Fri Mar 29 12:25:20 GMT 2024

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

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

Back to the top