Title: Path Locks for XML Document Collaboration
1Path Locks for XML Document Collaboration
- Stijn Dekeyser and Jan Hidders
- University of Antwerp
The 3rd International Conference on Web
Information Systems Engineering WISE02
2Overview of the Talk
- Running example
- Motivation
- Table, predicate, hierarchical locking
- Data model and manipulation language
- Path lock schemes
- Path lock propagation
- Path lock satisfiability
- Results further research
3Running Example
ltdocument id"0"gt ltperson id"1", age"55"gt
ltnamegtPeterlt/namegt ltaddrgtParklane 7lt/addrgt
ltchildgt ltperson id"3", age"22"gt
ltnamegtJohnlt/namegt ltaddrgtUnistreet
1lt/addrgt lthobbygtswimminglt/hobbygt
lthobbygtcyclinglt/hobbygt lt/persongt
lt/childgt ltchildgt ltperson id"4",
age"7"gt ltnamegtDavidlt/namegt
ltaddrgtParklane 7lt/addrgt lt/persongt
lt/childgt lt/persongt ltperson id"2", age"43"gt
ltnamegtMarylt/namegt ltaddrgtParklane 7lt/addrgt
lthobbygtpaintinglt/hobbygt lt/persongt lt/documentgt
4Motivation Table Locking
- In simple RDBs to prevent phantoms
- Entire table locked in case of update
- XML parent-child rel.ship in 1() table
- Example
- Query //child//hobby
- Update which should be allowed change hobby not
appearing under a child - Not possible since table is locked
5Motivation Predicate Locking
- Improvement to table locking
- Predicate indicates which tuples are read
- Example
- Query /document/person//hobby
- Update that should be allowed create a person
under the root element - Subsequent update that should not be allowed
create new hobby under person - Not possible since first predicate will lock all
persons under the root
6Motivation Hierarchical and Tree Locking
Protocols
- Hierarchical (multigranularity) locking
- Lock granule ? intention lock on ancestors
- Extend granule X ? exclusive lock on X
- Tree locking
- Lock node ? lock parent of the node
- Add node under X ? exclusive lock on X
- A query //A//B requires shared locks on the
entire tree, preventing updates
7Data Model, Query Language
- Data Model
- XPath data model (order, attributes, )
- Query Language
- Simple XPath (surface syntax)
- text() function denoted by ?
- string-value() function denoted by ?
- E.g. //child///hobby/?/?, person/addr
- User has set of variables to store intermediate
query results - path expressions can start from previous results
8Update Language
- Primitives for element nodes similar for
attribute and text nodes - create-element-under(e-id, tagname)
- New node immediately after last child of e-id
- delete-leaf-element(e-id)
- Variants for under before and after
- Parameters nodes extracted by earlier queries ?
writing implies reading
9Path Lock Propagation (1)
- Read Locks rl(n, p) e.g. rl(n, //a//b)
- Initial read lock set
- If q xm/p then Rq (n,p) n in xm
- Read lock inference
- .//p gt p and ./p gt p
- Read lock propagation
- rl(x, .//p) -gt rl(y, .//p) if y is child elem of
x - rl(x, t/p) -gt rl(y, p) if y is child elem of x
named t - rl(x, t//p) -gt rl(y, p) if y is child elem of x
named t - rl(x, /p) -gt rl(y, p) if y is child element of x
- rl(x, //p) -gt rl(y, .//p) if y is child element
of x - Etc. for attributes and text nodes
- Recomputation on update is cheap
10Path Lock Propagation (2)
.//child//hobby
child//hobby
//child//hobby
Doc. root
.//child//hobby
child//hobby
document
.//child//hobby
child//hobby
.//child//hobby
person
person
child//hobby
.//hobby
child
child
_at_age
name
addr
hobby
addr
name
_at_age
.//child//hobby
child//hobby
.//child//hobby
.//hobby
child//hobby
hobby
person
person
_at_age
name
addr
hobby
hobby
_at_age
name
addr
11Path Lock Propagation (3)
- Write Locks wl(n, f) e.g. wl(n, ), wl(n, a)
- Create-element-under(n, t)
- A t lock on node n
- Delete-leaf-element(n)
- A t lock on n, where n is the parent of n and t
is the tag name of n. - A lock on n
- Thus, write locks are local and consist of a
single symbol
12Path Lock Propagation (4)
- Lock compatibility
- Ordered trees
- Two read locks never conflict
- rl(n, p) conflicts with wl(n, f) iff p f or p
- wl(n, f) conflicts with wl(n, f) iff f f or
f - Unordered trees
- First two rules identical
- Two write locks never conflict
13Path Lock Satisfiability (1)
- Read Locks rl(n, p) e.g. rl(n, //a//b)
- Only the initial read lock set is needed
- If q xm/p then Rq (n,p) n in xm
- Etc.
- No inference nor propagation
- Write Locks wl(n, f) e.g. wl(n, ), wl(n, a)
- Exactly the same as in Propagation system
14Path Lock Satisfiability (2)
- Lock compatibility
- Ordered trees
- Two read locks never conflict
- rl(n, p) conflicts with wl(n, f) iff n is an
ancestor of n and path(n, n)/f satisfies p - wl(n, f) conflicts with wl(n, f) iff f f or
f - Unordered trees
- First two rules identical
- Two write locks never conflict
15Results Further Research
- Scheduler and Serializability
- Operations can be swapped locally
- Scheduler needs an Instance Graph
- Technical Report ftp//win-ftp.uia.ac.be/dekeyser/
cscheduler.pdf - Using references
- Naïve simulation
- Adding a Move operator
- Identity of nodes