On 4 Aug 2004 at 9:26, Oliver Zeigermann wrote:

> Andreas Probst wrote:
> > On 3 Aug 2004 at 10:49, Oliver Zeigermann wrote:
> >>What you describe is the locking the RDBMS / file store would do anyway. 
> >>However, if you acquire all those locks atomically at the very beginning 
> >>of the request deadlocks are impossible, I guess. Do you do that? May be 
> >>a good idea...
> > 
> > 
> > Yes, I simply don't start a transaction if I can't get all the 
> > locks. So no dead lock anymore.
> 
> What kind of lock do you use?

I just use URI String objects. For instance if a thread has an 
exclusive lock on the String "/files", no other thread can get 
any lock on "/files". I developed some classes organizing these 
locking stuff. This way also no thread can get any lock on 
"/files/col". As long as the thread can't get the lock, it can't 
get into the store -> so no database action. It waits until the 
lock is released.

The actual challenge is to know, which lock (shared/exclusive) 
to acquire for which part of the URI.

You described the problem with the history folder. If a new VHR 
is created, then /history needs to be exclusively locked. If the 
lastmodified would not be set on /history - and I think it's 
meaningless there - then /history only needs a shared lock, 
which means other threads/clients can create VHR's too. Is it OK 
with Binding and DeltaV not to set the lastmodified?

Regards,

Andreas

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to