[xwiki-notifications] [Issue] Commented: (XWIKI-2191) When user logout, his pages locks should be removed

Sergiu Dumitriu (JIRA) jira at xwiki.org
Sat May 3 03:05:54 CEST 2008


    [ http://jira.xwiki.org/jira/browse/XWIKI-2191?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_25322 ] 

Sergiu Dumitriu commented on XWIKI-2191:
----------------------------------------

Asiri, the current fix does not cover the multiwiki case.

It will be very hard to delete all the locks in all virtual wikis, due to performance reasons (in a setup with thousands of virtual wikis it will be inefficient to iterate on all of them).

Still, I think that you should also take into account the case when the user is global, and remove lock both from the current non-main wiki and the main wiki. A pseudocode would be like:
{code:none}
if the wiki is not virtual
  delete locks
else
  if the user is global and the current wiki is non-main
    delete locks
    switch to the main wiki
    delete locks for the local username
    switch back to the original wiki
  else
    delete locks
{code}
which can be rewritten as:
{code:none}
delete locks
if the wiki is virtual and the user is global and the current wiki is non-main
  switch to the main wiki
  delete locks with the local username
  switch back to the original wiki
{code}

To share the comments I sent in private to Asiri, I don't like the patch because it introduces code that doesn't concern authentication in the authenticator class, adding hibernate, queries and Locks in a place that should only check the password. But I don't seem to find a better place where that can be performed without changing lots of things in the XWiki architecture, which is quite dangerous. So for the moment this seems to be the only possible fix for this issue.

In the future I'd rather implement optimistic edit locking and remove completely these locks...

> When user logout, his pages locks should be removed
> ---------------------------------------------------
>
>                 Key: XWIKI-2191
>                 URL: http://jira.xwiki.org/jira/browse/XWIKI-2191
>             Project: XWiki Core
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.3
>            Reporter: Thomas Mortagne
>         Assigned To: Asiri Rathnayake
>         Attachments: XWIKI-2191-2.PATCH, XWIKI-2191.PATCH
>
>
> To reproduce:
> * log with a user
> * edit page
> * logout without saving or cancel page
> * log with another user
> * try to edit the same page

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.xwiki.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the notifications mailing list