Bug 37857

Summary: AclMethod tries to access nodestore with an incomplete slideToken
Product: Slide Reporter: Constantine Vetoshev <gepardcv>
Component: WebDAV ServerAssignee: Slide Developer List <slide-dev>
Status: NEW ---    
Severity: normal    
Priority: P3    
Version: 2.1   
Target Milestone: ---   
Hardware: All   
OS: All   

Description Constantine Vetoshev 2005-12-10 00:55:54 UTC
I'm using Sybase 15.0 for my node store, and I found that it deadlocks when I
try to create a user account and then give that user account permissions in one
external (JBoss JCA) transaction. I tracked the bug down to AclMethod.java:234.

First, AclMethod.parseRequest is called. At this point, the slideToken does not
yet know about any external transactions which may be running. (That happens
later, in AbstractWebdavMethod.run.) The parseRequest method calls
createNodePermissionList, which then calls createActionUri, which calls
structure.retrieve. This last call then takes the incomplete slideToken object,
and tries to retrieve something from the node store database. Since it cannot
join the existing transaction, it tries to request an exclusive row-level lock,
which Sybase is already holding, and blocks forever.

I can switch isolation level down to REPEATABLE_READ in Domain.xml, which does
solve the problem, but that sounds wrong. It seems to me that a WebDAV method
which ignores the fact that it's running inside a transaction is doing the wrong
thing. MySQL does not deadlock here, so it's probably doing a dirty read in
spite of the SERIALIZABLE isolation level setting.

What exactly is the right thing to do? I'll be happy to implement a fix if
anyone can suggest a good approach. A nasty approach would be to grab the
transaction information from the header and apply changes to the slideToken
before the structure.retrieve call, but that would amount to copying code from
AbstractWebdavMethod.run.