You are viewing a plain text version of this content. The canonical link for it is here.
Posted to slide-user@jakarta.apache.org by James Higginbotham <jh...@betweenmarkets.com> on 2003/03/20 17:32:28 UTC

Tracking user locks in a webapp?

Hi, 

Just wanted to throw out a question and see if anyone has solved this
better than my initial approach might.. I am trying to use a web
application to lock and edit a file. Since the kernel APIs requires the
lock ID to be passed in to unlock a resource, I was considering just
keeping a transient list of lockIds in the user's session. If I set the
default lock timeout period to just under what the HTTP session timeout
is set for, I can be assurred that the transient list will be in sync
(relatively speaking) with the actual lock(s) held by a currently signed
in user. Any thoughts on better approaches? I am assuming that there
isn't some all-powerful getLocksForUser() api hidden somewhere that
would help me out more here (allowing a uri -> lock ID lookup) or some
other method short of brute force killing a lock. 

Thanks,
James

Re: Tracking user locks in a webapp?

Posted by Kevin Moran <gr...@yahoo.com>.
Hi James,
    Just curious, are you allowing more than one
person to lock a file for editing at the same time? 
If so, I'm not sure I have a cleaner approach than
what you described.  But if your intent is that only
one person can edit a file at a time, why not just use
the form of Lock.kill() that takes in a SlideToken and
a SubjectNode?  It's kind of heavy-handed, but it does
unlock a URI and means you wouldn't have to maintain a
list of the lock IDs.

-kevin

--- James Higginbotham
<jh...@betweenmarkets.com> wrote:
> Hi, 
> 
> Just wanted to throw out a question and see if
> anyone has solved this
> better than my initial approach might.. I am trying
> to use a web
> application to lock and edit a file. Since the
> kernel APIs requires the
> lock ID to be passed in to unlock a resource, I was
> considering just
> keeping a transient list of lockIds in the user's
> session. If I set the
> default lock timeout period to just under what the
> HTTP session timeout
> is set for, I can be assurred that the transient
> list will be in sync
> (relatively speaking) with the actual lock(s) held
> by a currently signed
> in user. Any thoughts on better approaches? I am
> assuming that there
> isn't some all-powerful getLocksForUser() api hidden
> somewhere that
> would help me out more here (allowing a uri -> lock
> ID lookup) or some
> other method short of brute force killing a lock. 
> 
> Thanks,
> James
> 


__________________________________________________
Do you Yahoo!?
Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop!
http://platinum.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: slide-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: slide-user-help@jakarta.apache.org