XPath-based Concurrency Control for XML Data

Similar documents
CS 361 Meeting 12 10/3/18

Roadmap. XML Indexing. DataGuide example. DataGuides. Strong DataGuides. Multiple DataGuides for same data. CPS Topics in Database Systems

Propositional Logic. Combinatorial Problem Solving (CPS) Albert Oliveras Enric Rodríguez-Carbonell. May 17, 2018

Construction of asymmetric orthogonal arrays of strength three via a replacement method

Higher order derivatives

The Matrix Exponential

The Matrix Exponential

cycle that does not cross any edges (including its own), then it has at least

Search sequence databases 3 10/25/2016

That is, we start with a general matrix: And end with a simpler matrix:

Week 3: Connected Subgraphs

Abstract Interpretation: concrete and abstract semantics

Addition of angular momentum

1 Minimum Cut Problem

Addition of angular momentum

Homotopy perturbation technique

SCHUR S THEOREM REU SUMMER 2005

Function Spaces. a x 3. (Letting x = 1 =)) a(0) + b + c (1) = 0. Row reducing the matrix. b 1. e 4 3. e 9. >: (x = 1 =)) a(0) + b + c (1) = 0

Homework #3. 1 x. dx. It therefore follows that a sum of the

COUNTING TAMELY RAMIFIED EXTENSIONS OF LOCAL FIELDS UP TO ISOMORPHISM

UNTYPED LAMBDA CALCULUS (II)

2 AN OVERVIEW OF THE TENSOR PRODUCT

ME 321 Kinematics and Dynamics of Machines S. Lambert Winter 2002

2.3 Matrix Formulation

(Upside-Down o Direct Rotation) β - Numbers

Final Exam Solutions

SECTION where P (cos θ, sin θ) and Q(cos θ, sin θ) are polynomials in cos θ and sin θ, provided Q is never equal to zero.

Strongly Connected Components

Application of Vague Soft Sets in students evaluation

Background: We have discussed the PIB, HO, and the energy of the RR model. In this chapter, the H-atom, and atomic orbitals.

Introduction to Arithmetic Geometry Fall 2013 Lecture #20 11/14/2013

Section 6.1. Question: 2. Let H be a subgroup of a group G. Then H operates on G by left multiplication. Describe the orbits for this operation.

First derivative analysis

Aim To manage files and directories using Linux commands. 1. file Examines the type of the given file or directory

2F1120 Spektrala transformer för Media Solutions to Steiglitz, Chapter 1

22/ Breakdown of the Born-Oppenheimer approximation. Selection rules for rotational-vibrational transitions. P, R branches.

Chapter 6 Folding. Folding

ECE602 Exam 1 April 5, You must show ALL of your work for full credit.

Einstein Equations for Tetrad Fields

PHA 5127 Answers Homework 2 Fall 2001

Data Assimilation 1. Alan O Neill National Centre for Earth Observation UK

Estimation of apparent fraction defective: A mathematical approach

Searching Linked Lists. Perfect Skip List. Building a Skip List. Skip List Analysis (1) Assume the list is sorted, but is stored in a linked list.

4. Money cannot be neutral in the short-run the neutrality of money is exclusively a medium run phenomenon.

Answer Homework 5 PHA5127 Fall 1999 Jeff Stark

Abstract Interpretation. Lecture 5. Profs. Aiken, Barrett & Dill CS 357 Lecture 5 1

ph People Grade Level: basic Duration: minutes Setting: classroom or field site

A Propagating Wave Packet Group Velocity Dispersion

CPSC 665 : An Algorithmist s Toolkit Lecture 4 : 21 Jan Linear Programming

LINEAR DELAY DIFFERENTIAL EQUATION WITH A POSITIVE AND A NEGATIVE TERM

EXST Regression Techniques Page 1

A Sub-Optimal Log-Domain Decoding Algorithm for Non-Binary LDPC Codes

Basic Polyhedral theory

u 3 = u 3 (x 1, x 2, x 3 )

Recall that by Theorems 10.3 and 10.4 together provide us the estimate o(n2 ), S(q) q 9, q=1

3 Finite Element Parametric Geometry

10. The Discrete-Time Fourier Transform (DTFT)

The Equitable Dominating Graph

4.2 Design of Sections for Flexure

Exam 1. It is important that you clearly show your work and mark the final answer clearly, closed book, closed notes, no calculator.

General Notes About 2007 AP Physics Scoring Guidelines

Middle East Technical University Department of Mechanical Engineering ME 413 Introduction to Finite Element Analysis

u x v x dx u x v x v x u x dx d u x v x u x v x dx u x v x dx Integration by Parts Formula

Quasi-Classical States of the Simple Harmonic Oscillator

1 Isoparametric Concept

What are those βs anyway? Understanding Design Matrix & Odds ratios

Properties of Phase Space Wavefunctions and Eigenvalue Equation of Momentum Dispersion Operator

Fourier Transforms and the Wave Equation. Key Mathematics: More Fourier transform theory, especially as applied to solving the wave equation.

On spanning trees and cycles of multicolored point sets with few intersections

1. Review of general exponentiation algorithms

Some remarks on Kurepa s left factorial

Evaluating Reliability Systems by Using Weibull & New Weibull Extension Distributions Mushtak A.K. Shiker

COHORT MBA. Exponential function. MATH review (part2) by Lucian Mitroiu. The LOG and EXP functions. Properties: e e. lim.

Learning Spherical Convolution for Fast Features from 360 Imagery

Partition Information and its Transmission over Boolean Multi-Access Channels

Numerical considerations regarding the simulation of an aircraft in the approaching phase for landing

What is a hereditary algebra?

10. Limits involving infinity

Hospital Readmission Reduction Strategies Using a Penalty-Incentive Model

From Elimination to Belief Propagation

The influence of electron trap on photoelectron decay behavior in silver halide

Category Theory Approach to Fusion of Wavelet-Based Features


Brief Introduction to Statistical Mechanics

Symmetric centrosymmetric matrix vector multiplication

Dealing with quantitative data and problem solving life is a story problem! Attacking Quantitative Problems

COMPUTER GENERATED HOLOGRAMS Optical Sciences 627 W.J. Dallas (Monday, April 04, 2005, 8:35 AM) PART I: CHAPTER TWO COMB MATH.

Classical Magnetic Dipole

NEW APPLICATIONS OF THE ABEL-LIOUVILLE FORMULA

Observer Bias and Reliability By Xunchi Pu

MATH 319, WEEK 15: The Fundamental Matrix, Non-Homogeneous Systems of Differential Equations

MCB137: Physical Biology of the Cell Spring 2017 Homework 6: Ligand binding and the MWC model of allostery (Due 3/23/17)

The second condition says that a node α of the tree has exactly n children if the arity of its label is n.

Similarity Queries: Their Conceptual Evaluation, Transformations, and Processing

Differentiation of Exponential Functions

On the irreducibility of some polynomials in two variables

Estimation of odds ratios in Logistic Regression models under different parameterizations and Design matrices

As the matrix of operator B is Hermitian so its eigenvalues must be real. It only remains to diagonalize the minor M 11 of matrix B.

Exercise 1. Sketch the graph of the following function. (x 2

Differential Equations

Transcription:

XPath-basd Concurrncy Control for XML Data Eun HYE CHOI and Tatsunori KANAI Corporat Rsarch & Dvlopmnt Cntr, Toshiba Corporation 1, Komukai Toshiba-cho, Saiwai-ku, Kawasaki-shi, 212 8582 Japan E-mail: {unhy.choi,tatsunori.kanai}@toshiba.co.jp Abstract For concurrncy control of XML data, this papr proposs a nw locking mthod basd on XPath with a nw data managmnt modl. Although incrasing concurrncy for XML data bcoms an important issu in XML data managmnt, fw ffctiv mthods providing high concurrncy of transactions working on th sam XML documnt hav bn proposd so far. To ovrcom this problm, w propos a locking mthod that can achiv high concurrncy whil guaranting th srializability of transactions to th sam XML documnt. In th proposd mthod, logical locks ar st on XPath xprssions usd in transaction accsss, and conflicts that violat srializability ar dtctd ach tim a rad or a writ accss is rqustd by concurrnt transactions. Efficint algorithms for dtcting conflicts ar also proposd in this papr. Sinc th proposd locking is at th lvl of prcis data in XML documnts, high concurrncy for XML data can b achivd assuring srializability. Ky words Concurrncy control, XML data managmnt, XPath, Locking, Srializability, Phantom problm 1. Introduction 1. 1 Backgrounds As th Xtnsibl Markup Languag (XML) [2] bcoms a widly adoptd standard for data rprsntation in various application aras, th numbr of XML documnts is rapidly growing and th subsqunt nd for sharing XML documnts by diffrnt applications and multipl usrs is incrasing. Concurrncy control of transactions working on th sam documnt is thus an important issu in XML data managmnt. Srializability, which rquirs that concurrnt transactions must produc th sam rsult as th sam transactions xcutd in a crtain squntial ordr, has bn considrd as a fundamntal problm for concurrncy control, and locking is known as a robust tchniqu to handl this problm. Locking to nsur th srializability has bn xtnsivly invstigatd for traditional RDBMSs, but not yt for XML data managmnt systms. In th prsnt XML data managmnt, XML documnts ar usually stord ithr to rlational databass as BLOBs or to nativ XML databass as XML format. Howvr, in both cass, locking is oftn at th lvl of ntir documnts and thus no concurrncy of transactions to th sam documnts is actually providd [1]. Th aim of this papr is to ovrcom this problm and to achiv high concurrncy for XML documnts whil nsuring srializability. In ordr to nsur th srializability of transactions, locking must prvnt th phantom problm [5]. A phantom indicats th data that was alrady disappard from or will appar to a databas, and thus locking on such phantoms is difficult sinc th phantoms do not physically xist at th tim of locking. To solv th phantom problm, two wll-known forms of locking hav bn proposd so far: physical indx-basd locking and logical prdicat-basd locking. Th indx-basd locking, such as ky rang locking [9], prvnts th phantom problm by locking on th indx ntry to th phantom. So far, bcaus of low locking cost and usful indx structur such as th B-Tr [7], th indx-basd locking hav bn widly adoptd for RDBMSs. Howvr, th indx-basd locking is not applicabl for XML data managmnt in th absnc of an fficint indx structur for an XML documnt modl. Th prdicat-basd locking, such as prdicat locking [5] and prcision locking [8], prvnts th phantom problm by locking on th prdicat that idntifis th phantom. In th prdicat locking, any conflict to violat srializability is dtctd by chcking if two prdicats usd in concurrnt transaction accsss ar mutually satisfiabl. Th prdicat locking is mor gnral than th indx-basd locking, but is mor xpnsiv sinc such th satisfiability problm btwn arbitrary two prdicats is known to b NP-complt. To ovrcom this shortcoming, th prcision locking prforms th conflict chck btwn prdicats and updats, instad of that btwn two prdicats, in th following way: As a transaction prforms a rad accss and a writ accss, th prdicat usd in th rad accss and th updat by th writ accss ar postd in a prdicat list and an updat list, rspctivly. In ordr to dtct a conflict btwn prdicats and updats by diffrnt transactions, ach prdicat (updat) postd is chckd against updats (prdicats) by othr transactions in th updat list (th prdicat list). Th prcision locking prforms th conflict chck against only actual prdicats and updats, and thus provids high concurrncy and a rlativly lowr cost than th prdicat locking. Inhrntly, w conjctur that th concpt of th prcision locking could b hlpful to nsur srializability in XML data managmnt. Howvr, th problm to prform practical conflict chcks that can handl XML documnts still rmains. 1. 2 Nw Rsults Our contribution is a nw locking mthod that guarants srializability and provids high concurrncy of transactions to th sam XML documnts. To our bst knowldg, th only on mthod by Grabs t al. [6] tackld th sam concurrncy control problm for XML documnts so far. Thy proposd a combination of wllknown granularity locking and prdicat locking which provids high concurrncy, but thir locking is applicabl to only rstrictd XML documnts with simpl XPath qury for transaction accsss. Against [6], our mthod allows gnral XML documnts and full XPath qury. In th proposd mthod, ach tim an accss is rqustd, conflict chcks to nsur srializability ar prformd in th following way: As for ach rad accss, conflicts against all

<?xml vrsion="1.0"?> < flowrs > < flowr > <nam> Tulip </nam> <color> Yllow </color> <pric unit=''jpy''> 150 </pric> < /flowr > < flowr > <nam> Ros </nam> <color> Rd </color> <pric unit=''jpy''> 500 </pric> </ flowr > </ flowrs > flowr flowrs nam color pric a unit=jpy t t t Tulip Yllow 150 x flowr y nam color pric a unit=jpy t t t Ros Rd 500 flowr flowrs nam color pric a unit=jpy t t t Tulip Yllow 150 Fig. 1 An xampl XML documnt. Fig. 2 A documnt tr. Fig. 3 An updatd documnt. x flowr nam color pric a unit=jpy t t t Ros Rd 350 y prvious writ accsss by distinct transactions ar chckd. As for ach writ accss, conflicts against all prvious rad accsss by distinct transactions ar chckd. In th following, th formr is calld a rad-writ chck; th lattr is calld a writ-rad chck. Th basic idas of th proposd mthod ar as follows. First, w introduc a nw data managmnt modl, which handls th thr kinds of documnts: an original documnt in th databas, dnotd by D st, (2) a copy of D st for ach transaction T i, dnotd by D i and (3) a copy of D st for dtcting conflicts, dnotd by D all. Each transaction T i has accsss to documnt D i instad of original documnt D st, and writ accsss by T i updat both D i and D all. Documnt D all thus rprsnts th documnt stat updatd by all transactions. Only whn T i commits, th updats by T i ar rflctd in D st. Nxt, w propos a logical locking approach in which locks ar st on th XPath xprssions usd rad accsss and conflicts btwn th XPath xprssions and th updats by writ accsss ar chckd. To dtct conflicts, chcking th satisfiability of an updat with an XPath xprssion is ncssary but is difficult sinc XPath is a path-basd and smistructurd qury languag, not a gnric boolan prdicat. In ordr to handl this dficincy, w prsnt a sufficint condition such that any conflict btwn th XPath xprssion and th updat can b dtctd by chcking th condition whn valuating th xprssion on two documnts such that on contains th updat and th othr dos not. Th proposd locking thus rsolvs th phantom problm by rgarding XPath xprssions as prdicats. Basd on our data managmnt modl and XPath-basd locking, conflicts btwn concurrnt transaction accsss ar chckd as follows: Th rad-writ chck is prformd by comparing nods in documnts D i and D all which ar rachabl whn valuating XPath xprssions. Sinc th updats of all prvious writ accsss ar rflctd in D all, th rad-writ chck can b compltd by just on comparison using D all. On th othr hand, daling with th writ accss is typically complicatd much mor than daling with th rad accss. Th writ-rad chck is prformd basd on th ida of using prvious stats of D all. W also prsnt an algorithm to dynamically dtrmin whthr th currnt stat of D all provids a larg ffct on subsqunt writ-rad chcks. In addition, w show that th proposd schduling of saving prvious stats of D all is always optimal in trms of th ffcts obtaind. 2. Prliminaris This sction dscribs th XML documnt modl and th transaction accss modl usd in our rsarch. 2. 1 XML Documnt Modl An XML documnt is modld as a tr, which dtails th parntchild rlationship btwn various lmnts of th documnt. Each nod in th tr has a typ such as lmnt, txt and attribut. (For mor dtail of XML, rfr to [2].) In th following, an XML documnt is rfrrd to as a documnt for short. Fig. 1 and Fig. 2 rspctivly show an xampl XML documnt and its rprsntation as a tr. In Fig. 2,, t and a attachd to ach nod rprsnt that th nod typ is lmnt, txt and attribut, rspctivly. 2. 2 Transaction Modl W considr a st of concurrnt transactions T = {T 1,,T n} (n > = 2) which accsss th sam documnt whr n dnots th numbr of transactions. Hraftr, th trm transactions mans concurrnt activ transactions othrwis indicatd. In this papr, th cas whr a transaction accsss to mor than on documnt is not considrd sinc such accsss could b classifid into th accsss to ach documnt and only accsss to th sam documnt is important whn considring concurrncy control. Each transaction squntially prforms svral rad accsss (Raccsss, for short) and writ accsss (W-accsss, for short) to th documnt. Th tim-ordrd squnc of th accsss by transaction T i is rfrrd to as an accss squnc of T i and is dnotd by AS i. Th accss squnc of T i thn consists of rad squncs (Rsquncs, for short) and writ squncs (W-squncs, for short), and is modld as illustratd in Fig. 4. An rad squnc (writ squnc) indicats a squnc of conscutiv rad accsss (writ accsss) in th accss squnc. W also dfin th following notations: WS i(k) (k >0) : th k-th writ squnc of T i. WS i(k) : th numbr of writ accsss in WS i(k). wn i : th currnt numbr of writ squncs of T i. RS i(k) (k > = 0):ifk =0, th first rad squnc; othrwis, th rad squnc right aftr writ squnc WS i(k). Fig. 4 shows an xampl accss squnc of a transaction T i. In th figur, th box and th vrtical lin rprsnt a writ accss and a rad squnc which contains on or mor rad accsss, rspctivly. Writ squncs WS i and WS i(2) ar th first and th scond writ squncs rspctivly, and WS i = 1 and WS i(2) =2. Rad squnc RS i(0) dnots th rad squnc bfor th first writ accss, and rad squncs RS i and RS i(2) follow right aftr WS i and WS i(2), rspctivly. 2. 3 XPath Accss Modl W assum that transactions hav accsss to th documnt using th XPath [4], which is th languag to addrss parts of th XML documnt and is bing usd as a bas in a numbr of othr XML standards such as XQury [3]. W assum that th radr is familiar with XPath and basic notations such as an XPath xprssion, a location path, and an axis. (For th dtail of XPath, rfr to [4].) An R-accss is prformd to th documnt by spcifying an XPath xprssion that idntifis a nod (or nods) in th documnt. A rad opration is rprsntd by Rad(path) with XPath xprs-

Start Finish (Commit or Abort) T i RSi(0) WSi RSi WSi(2) RSi(2) : : writ accss rad accss squnc WSi(k) : k-th writ squnc RSi(k) : rad squnc aftr WSi(k) Fig. 4 An accss squnc of transaction T i. sion path. A W-accss is prformd to th documnt by spcifying a writ opration and th targt nod (or nods) of th writ opration. Th targt nod is slctd by th R-accss to th documnt. W considr thr kinds of writ oprations on th documnt: insrt, dlt, and rplac. Th insrt opration and th dlt opration could b to insrt and dlt a nod (or nods) in th documnt. Th rplac opration could b to rplac th valu of a nod, such as an lmnt nod or an attribut nod, with a nw valu. Not that th proposd locking dos not dpnd on th typ of writ opration. Exampl 1 Considr th documnt shown in Fig. 2. First, suppos that an R-accss Rad(path) with path= flowr[nam=ros] /pric is prformd to th documnt. XPath xprssion path is valuatd on th documnt and thn lmnt nod pric containd in flowr lmnt whos nam lmnt has th valu of Ros is slctd. Th slctd nod is nod y in Fig. 2. Th slctd nod is markd with bold lins in Fig. 2. Not that th valu of th slctd nod is 500, that is th valu of its child txt nod. Nxt, suppos that a W-accss that rplacs th valu of th slctd nod by th R-accss to 350 is prformd to th documnt. Th documnt is thn updatd by th W-accss as shown in Fig. 3. Th updatd parts ar markd with bold lins in Fig. 3. 3. Proposd Locking Mthod In ordr to nsur th srializability, a locking mthod must prvnt any conflict btwn R-accsss and W-accsss xcutd concurrntly by diffrnt transactions. Th proposd locking mthod dtcts conflicts btwn XPath xprssions usd in R-accsss and updats by W-accsss by diffrnt transactions undr our data managmnt modl. This sction dscribs a nw data managmnt modl and th ovrviw of conflict chck. 3. 1 Data Managmnt Modl Th data managmnt modl is illustratd in Fig. 5 whr ach triangl rprsnts a documnt stat and th following thr kinds of documnt stats ar containd: D st : th committd documnt stat in th databas. D i for T i : th documnt stat containing th updats of T i. D all : th documnt stat containing th updats of all activ transactions. Th stat of D st is copid to D all initially, and as a nw transaction T i is issud, documnts D st, D i and D all ar handld and updatd in th following mannr: Whn T i starts, gnrat D i as a copy of D st. (2) Whil T i procds, T i accsss to D i instad of D st. Whn D i is updatd by ach W-accss of T i, th updat is also rflctd in D all. (3) Whn T i commits, rflct th updats by T i in D st. (4) Whn T i aborts, D i is just dltd and D all is rgnratd start T 1 D st D 1 D i D n (2) procd Fig. 5 T i D all (3) commit T n (4) abort Data managmnt modl. Prvious accss by othr transactions Rad Writ Rqustd Rad a) b) accss Writ c) d) mans that th dtction of a conflict is ndd. Fig. 6 Conflicts to b chckd. for taking away th updats by T i rflctd in D all. In our data managmnt modl, th abort or rollback of a transaction can b asily handld sinc th updats by ach transaction T i ar rflctd in documnt D i but D st. Documnt D all containing th updats of all transactions is usd for th proposd locking mthod to fficintly dtct conflicts to violat srializability. Hr w dfin th quivalnc of nods in distinct documnts. Nods ar quivalnt to ach othr in th following cass: on is copid from th othr, (2) nods ar copid from th sam nod, (3) nods ar th sam updats containd in diffrnt documnts. For two sts of nods, N = {v 1,,v m} and N = {v 1,,v m}, in distinct documnts, N is quivalnt to N iff v j v j for any 1 < = j < = m. For xampl, considr th documnts shown in Fig. 2 and Fig. 3 again. Nods x s in th two documnts ar quivalnt but nods y s ar not quivalnt to ach othr. In addition, w dfin mrging two documnts D i and D j as follows: th updatd part of T i containd in D i, th updatd part of T j containd in D j and th quivalnt part ar rflctd in th rsult documnt. Not that th updatd part, i.. nods, in D i and th updatd part in D j ar mutually disjoint. Suppos that thr ar such nods, thn thr ar prvious W-accsss by T i and by T j that conflict with ach othr. As will b shown latr, such a conflict is dtctd whn th W-accss is rqustd. In th following, th trm Mrg(D i,d j) dnots th documnt mrging D i and D j. 3. 2 Conflict Chck In th proposd locking, ach tim a transaction rqusts an R- accss or a W-accss, chcking conflicts of th accss against prvious accsss by othr transactions is prformd. Among th four cass shown in Fig. 6, chcking th rad-writ conflict (Cas b) and th writ-rad conflict (Cas c) is sufficint to nsur th srializability. Thr is no conflict btwn R-accsss. On th othr hand, th writ-writ conflict can b dtctd by th rad-writ conflict or th writ-rad conflict sinc, bfor a writ opration on som nods that lads to a conflict, a rad opration on th sam nods is prformd. Th proposd locking mthod consists of th following two phass for chcking conflicts: rad-writ chck (R-W chck, for short) and writ-rad chck (W-R chck, for short). Rad-Writ Chck : Each tim a transaction rqusts an R- accss, chck whthr th R-accss lads to th rad-writ conflict with prvious W-accsss of othr transactions. Writ-Rad Chck : Each tim a transaction rqusts a W- accss, chck whthr th W-accss lads to th writ-rad conflict

with prvious R-accsss of othr transactions. Whn a conflict is dtctd by th R-W chck or th W-R chck, a rqustd accss is dlayd until th othr transaction that th accss conflicts finishs. Actually which transaction is blockd can b dtrmind by transaction priority. Dadlock which occurs by blocking transactions could b dtctd by using wll-known solutions such as th wait-for graph [7]. Th proposd algorithms for th R-W chck and th W-R chck ar givn in Sction 4 and Sction 5, rspctivly. 4. Rad-Writ Chck This sction dscribs th proposd mthod for th R-W chck. Each tim an R-accss is rqustd, th R-W chck is prformd for dtcting th R-W conflict causd by th R-accss. Th R-W conflict is dtctd basd on th XPath valuation undr our data managmnt modl. A conflict of an R-accss with prvious W- accsss mans that th rsult of th R-accss to a documnt is diffrnt from that to th documnt updatd by th W-accsss. Hraftr w dfin th boolan function Conf(R, W) to b tru iff an R-accss R conflicts a squnc, W, of W-accsss. Considr that a transaction T i rqusts an R-accss R i = Rad(path). In our data managmnt, R i is thn prformd to documnt D i and som nods on D i ar slctd by valuating XPath xprssion path on D i as a rsult. In th following, th function GtN(D i,path) is dfind as th nods on documnt D i slctd by XPath xprssion path. Lt W j dnot a squnc of prvious W-accsss by transaction T j.iffconf(r i, W j)=tru with R i = Rad(path), thn GtN(D i,path) GtN(Mrg(D i,d j),path). (4.1) (Sinc th prvious W-accsss of T j is rflctd in D j, Mrg(D i,d j) is qual to th stat of D i updatd by W j.) Th conflict of R i with prvious W-accsss by any othr transaction T j is thn dtctd by chcking formula (4.1). Hr w not that an R-accss could conflict with W-accsss of mor than on transactions vn whn th R-accss dos not conflict with thos of ach of th transactions. For transactions T j and T h in (T {T i}), thr is a cas whr Conf(R i, W j +W h)=tru but Conf(R i, W j) tru and Conf(R i, W h) tru. Th conflict is thn dtctd by chcking if GtN(D i,r i) GtN(D i,r i) whr D i is th stat of D i mrging both D j and D h. On th othr hand, thr is also a cas whr Conf(R i, W j) = tru or Conf(R i, W h) = tru but Conf(R i, W j + W h) tru. Hnc th R-W conflict of R i with prvious W-accsss nds to b chckd against all combinations of transactions in (T {T i}),but such a conflict chck against all th combinations is xtrmly tim consuming. (Th numbr of all combinations to b considrd for ach R-accss is 2 n 1 1.) To handl this problm, w prsnt a sufficint condition for th R-W conflict of R i such that a conflict causd by R i with prvious W-accsss by any st of othr transactions is dtctd by chcking if th condition holds in th XPath valuation on th stat of documnt D i updatd by th W-accsss of all transactions. In othr words, if R i causs a conflict with prvious W-accsss by any st of transactions in T {T i}, thn th condition holds with th stat of documnt D i updatd by W 1 + + W j + + W n(= W). In th following, w dfin th function GtD(D i, W) as th stat of documnt D i updatd by W-accsss W. Lt N j in GtD(D i, W) b th part, i.. nods, updatd by W j. For any N j and N h (j h), N j N h (4.2) sinc thr is no conflict btwn prvious W-accsss W j and W h. (Such th conflict was prviously dtctd.) In addition, for ach nod in N j, all nods in th subtr whos root is th nod ar also containd in N j. In th following xplanation for th conflict chck, w rfr to th smantics of XPath prsntd in [10], which is shown in Appndix A. Th proposd mthod howvr is a gnral approach that can b applicabl to any smantics for XPath. To sav spac, w omit th prcis xplanation for th smantics of XPath, so rfr to [10] for mor dtail. Th smantics of XPath is spcifid by thr functions S, Q, and E with two paramtrs: an axis a and a contxt nod x. Among th thr functions, both functions Q and E rcursivly call function S and th rsults of thm (boolan and numrical valu, rspctivly) ar dtrmind from th nods rturnd by S. Hr w thus concntrat on function S. Function S a [[p]]x dnots th nods slctd by location path p with paramtrs a and x. Whn XPath xprssion path is valuatd on documnt D i, function S could b calld svral tims for spcifying th rsulting nods on D i. W us th trm S a [[p]]x(d i) to indicat th rsult of S on D i. Lmma 1 and Thorm 1 thn hold. Lmma 1 If GtN(D i,path) GtN(D i,path) with XPath xprssion path and two documnts D i and D i, function S such that S a [[p]]x(d i) S a [[p]]x(d i) is calld in th valuation of path on D i and D i. proof: Suppos that such function S is not calld in th valuation of path, that is, S always rturns th quivalnt rsults for D i and D i. Thn, obviously, GtN(D i,path) GtN(D i,path). This is a contradiction. Thorm 1 Considr two sts, T and T, of transactions such that T T = and T +T = T {T i}. Lt W and W b prvious W-accsss of T and T, rspctivly. If R i(= Rad(path)) conflicts with W, function S such that S a [[p]]x(d i) S a [[p]]x(gtd(d i, W + W )) (4.3) is calld in th valuation of path on D i and GtD(D i, W +W ). proof: Lt W = W + W, D i = GtD(D i, W ), and D i = GtD(D i, W). By Lmma 1, th thorm holds if GtN(D i,path) GtN(D i,path). Othrwis, GtN(D i,path) GtN(D i,path) and thus function S such that S a [[p]]x(d i) S a [[p]]x(d i) is calld in th valuation of path on D i and D i. Thn, thr ar a nod y S a [[p]]x(d i) and a nod y S a [[p]]x(d i) such that y y. Morovr, by formula (4.2), thr is a nod y S a [[p]]x(d i ) such that y y. Sinc y y, S a [[p]]x(d i) S a [[p]]x(d i ). By Thorm 1, using documnt D i and a documnt updatd by transactions, th conflict btwn R-accss R i and prvious W- accsss of any subst of transactions can b dtctd. In our data managmnt, th updats by all prvious W-accsss ar rflctd in D all. Thus, if an R-accss R i = Rad(path) causs th R- W conflict with prvious W-accsss of any st of transactions, th valuation of path on D i and D all must call a function S such that S a [[p]]x(d i) S a [[p]]x(d all). (4.4) Hnc, th R-W conflict of R i is dtctd by chcking formula (4.4) whn function S is calld for th XPath valuation. Not that this is a sufficint condition for a conflict, i.., th calling such function S whos rsults ar not quivalnt dos not ncssarily lad to a

conflict. A mor fficint sufficint condition for th conflict chck is omittd hr (although w hav som ida) but will b addrssd in futur work. In addition, th quivalnc chck for function S is rducd in th following way. Considr th cas whr function S a [[p]]x(d i) rcursivly calls S a [[p ]]x (D i) with x S. As mntiond prviously, if a nod x in documnt D i (D all)isupdatd, nods in th subtr whos root is x ar also updatd. Hnc, if axis a is for sarching nods in th subtr of contxt nod x and formula (4.4) holds, thn S a [[p ]]x (D i) S a [[p ]]x (D all). Thrfor, whn function S is rcursivly calld by function S with such an axis, th quivalnc chck for S can b omittd sinc th conflict can b dtctd by th quivalnc chck for S. Exampl 2 Considr that T i rqusts an R-accss Rad(path) with path= flowr[pric<400]/nam. Suppos that D i quals to th documnt shown in Fig. 2 and D all quals to th documnt shown in Fig. 3, which was updatd by a prvious W-accss of th othr transaction. Whn path is valuatd on D i and D all, function S a [[pric]]x with a = child is calld. Th rsulting nod, y, of S on D i is not quivalnt to that on D all, that is, S a [[pric]]x(d i) S a [[pric]]x(d all). Thrfor, th conflict of th R-accss with th W-accss is dtctd. Hr w dfin th boolan function Chck(D,D,R) with two documnts D and D and R-accss R = Rad(path) as follows: Chck = ok if function S is calld in th valuation of path such that th rsulting nods on D ar not quivalnt to th rsulting nods on D ; Chck ok, othrwis. Th following thorm thn holds. Thorm 2 If an R-accss R i by a transaction T i lads to th R-W conflict, Chck(D i,d all,r i) ok. Th proposd algorithm for th R-W chck is thn as follows: Whn a transaction T i rqusts an R-accss R i, Chck if Chck(D i,d all,r i)=ok. (2) If it holds, thn R i causs no R-W conflict and thus T i procds. (3) Othrwis, R i causs a R-W conflict with othr transactions. Find transaction T j(i j, 1 < = j < = n) that causs th conflict with R i, and block T i until T j finishs. Whn T j finishs, T i rstarts. In th R-W chck, XPath valuation is procssd in both D i and D all. Th xcution cost ndd for th proposd algorithm is thn th sum of th cost for valuating an XPath xprssion and th cost for quivalnc chcks in th XPath valuation. Equivalanc chcks can b asily implmntd by, for instanc, sharing a pointr btwn quivalnt nods in distinct documnts. 5. Writ-Rad Chck This sction dscribs th proposd mthod for th W-R chck. Each tim a W-accss is rqustd, th W-R chck is prformd for dtcting th W-R conflict causd by th W-accss, using D all undr our data managmnt modl. Considr that a transaction T i rqusts a W-accss W i. In our data managmnt, W i is prformd to documnt D i, and thn D i is updatd by W i as a rsult. Lt D i = GtD(D i,w i). Lt R j b a prvious R-accss by any othr transaction T j. By thorm 2, if W i causs a conflict with R j, thn Chck(D j,mrg(d j,d i),r j) ok whr D j dnots th prvious stat of D j to that R j was prformd. Whn W i is rqustd, Such axs in XPath ar child, dscndant, slf, attribut, and namspac. tim t 1 tim t 2 T i W i Fig. 7 D' i T j WS j (k) R j RS j (k) WS j (k+1) D j Exampl two transactions. D j (k) D j (k+1) this conflict chck for W i is ndd against ach of all prvious R- accsss by any transaction T j( T {T i}). Thus all th prvious stats of D j s for ach T j ar ndd for th W-R chck whn T i rqusts a W-accss. Two simpl ways to obtain th prvious stats of D j s ar considrd: on is storing all th prvious stats and th othr is rgnrating th prvious stats by prforming prvious updats again. Howvr both of thm ar impractical if thr ar a numbr of concurrnt transactions and updats du to mmory and tim consuming, rspctivly. To ovrcom this dficincy, w prsnt th mthod for an fficint W-R chck using prvious stats of D all instad of using prvious stats of D j for vry transaction T j. 5. 1 Writ-Rad Chck using prvious D all s Considr a W-accss W i rqustd by T i and a prvious R-accss R j in R-squnc RS j(k) (0 < = k < = wn j) of T j. (Rcall that wn j is th currnt numbr of W-squncs of T j.) Now w dfin th notation D j(k) with (0 < = k < = wn j) as follows: if k =0, D j(k) =D st; othrwis, D j(k) =GtD(D st, W) whr W = WS j + + WS j (k). Thn D j(k) is quivalnt to th prvious stat of D j to that R-accss R j in RS j(k) is prformd. Hnc, a conflict with R j causd by W i is dtctd by chcking if D all Chck(D j(k),mrg(d i,d j(k)),r j) ok. (5.1) In th following xplanation, w rfr to Fig. 7, which illustrats an xampl of two transactions T i and T j. Suppos that W- squnc WS j(k) finishd and D j and D all wr updatd by th last W-accss in WS j(k) at tim t 1. Suppos also that th nxt W- squnc WS j(k +1)startd right aftr tim t 2. Documnt D j(k) is thn th stat of D j at any tim t with t 1 < = t < = t 2. (D j(k) quals to th stat of D j in which updats until WS j(k) ar rflctd.) Lt D all b th stat of D all at any tim t(t 1 < = t < = t 2). Documnt D all is th documnt stat updatd by all transactions by tim t, that is, D all is th documnt mrging D j(k) and all D l s(l j, 1 < = l < = n) at tim t. By Thorm 2, Chck(D j(k),d all,r j)=ok (5.2) sinc R j was chckd not to lad to th R-W conflict whn it is rqustd. By formula (5.1) and quation (5.2), w obtain th following thorm. Thorm 3 If a W-accss W i by a transaction T i lads to th W-R conflict, thr is an R-accss R j in RS j(k)(0 < = k < = wn j) by any othr transaction T j such that Chck(D all,mrg(d i,d all),r j) ok

whr D i = GtD(D i,w i) and D all is a prvious stat of D all at any tim aftr WS j (k) and bfor WS j(k +1). By Thorm 3, th W-R conflict causd by a rqustd W-accss with any R-accsss in RS j(wn j) can b dtctd by using th prvious stat of D all whn wn j was th currnt numbr of W- squncs of T j.) For th W-R chck using prvious stats of D all, th stats of D all thn nd ithr to b savd bfor updating or to b rgnratd whn chcking th conflict. If all th prvious stats of D all can b hld, no writ oprations for rgnrating th stats of D all is ndd for th W-R chck. Howvr, it is hardly a practical solution du to th limitation of mmory rsourcs. In th following, th trm sn max dnots th maximum numbr of stats of D all that can b hld in th systm. W assum that th valu of sn max can b changd dpnding on th availabl siz of mmory. An algorithm that dtrmins sn max stats of D all providing larg ffcts on subsqunt W-R chcks is proposd in Sction 5. 2. In th following, th proposd mthod for th W-R chck using prvious stats of D all is dscribd. W dfin svral notations for th following xplanation. Th trm s-point is usd to indicat th point of tim that th stat of D all is savd. sn(< = sn max) : th currnt numbr of s-points. sp(h) (1 < = h < = sn) : th h-th s-point. D s(h) : th stat of D all savd at s-point sp(h). wn i(h) for ach T i : th valu of wn i at s-point sp(h). W say that s-point sp(h) is st in writ squnc WS i(k) for ach transaction T i( T) if k = wn i(h). For ach R-squnc RS j (k)(1 < = k < = wn j), if thr is s- point sp(h) such that wn i(h) = k, thn th W-R chck against R-accsss in RS j(k) can b prformd using D s(h). Suppos that thr is no s-point sp(h) such that wn j(h) = k. Thr ar two cass to b considrd. Th first cas is that thr is s-point sp(h ) such that wn j(h )=k whr k is th maximum valu with k <k. Th scond cas is that thr is no such s-point sp(h ).In th first cas, th updats until W-squnc WS j(k ) ar rflctd in D s(h ). Lt D j b th stat of D s(h ) in which th updats by T j from WS j(k +1)to WS j(k) ar also rflctd. In th scond cas, lt D j b th stat of D st in which th updats by T j until W- squnc WS j (k) ar rflctd. Thn, in th both cass, th W-R chck against R-accsss in RS j(k) can b prformd using D j. Th proposd algorithm for th W-R chck is thn as follows: Whn a transaction T i rqusts a W-accss W i, Prpar D which is a copy of documnt D st, and prpar D i which is th stat of D i updatd by W i. (2) For ach transaction T j( T {T i}), xcut accsss from th first R-squnc to th R-squnc just bfor WS j(wn j), i., th W-squnc in which th first s-point is st. (2.1) If th accss is W-accss W j, rflct th updat by W j in documnt D. (2.2) If th accss is R-accss R j, thn chck if Chck(D, Mrg(D i,d),r j)=ok. If it holds, thn W i dos not conflict with R j, and thus go (2) and xcut th nxt accss. Othrwis, W i conflicts with R j, and thus block T i until T j finishs. Whn T j finishs, T i rstarts. (3) For ach s-point sp(h) with 1 < = h < = sn, (3.1) Prpar D which is a copy of documnt D s(h). (3.2) For vry transaction T j and vry R-accss R j in RS j(wn j(h)), chck if Chck(D, Mrg(D i,d),r j)=ok. If not so, W i conflicts with R j and thus block T i until T j finishs. Whn T j finishs, T i rstarts. (3.3) For ach transaction T j, if an s-point is not st in W-squnc WS j(wn j(h) + 1), xcut accsss from WS j(wn j(h) +1)to th R-squnc just bfor th W-squnc in which s-point sp(h +1)is st or to th latst R-squnc. (3.3.1) If th accss is W-accss W j, rflct th updat by W j in documnt D. (3.3.2) If th accss is R-accss R j, thn chck if Chck(D, Mrg(D i,d),r j)=ok. If it holds, thn W i dos not conflict with R j, and thus go (3.3) and xcut th nxt accss. Othrwis, W i conflicts with R j, and thus block T i until T j finishs. Whn T j finishs, T i rstarts. Th psudo cod of th proposd algorithm for th W-R chck basd on s-points is shown in Appndix B. Stps 1, 2, and 3 in Appndix corrspond to parts, (2), and (3) of th abov xplanation, rspctivly. By using th stats of D all that ar savd at s-points, th writ oprations for gnrating prvious stats of D all in subsqunt W-R chcks ar rducd. Th numbr of writ oprations can b rducd by ach s-point sp(h) is rfrrd as E(h) in th following sction. (Th dfinition of E(h) and th dtrmination of s-point sp(h) providing a larg valu of E(h) ar givn in Sction 5. 2.) Lt nr j and nw j b th numbr of R-accsss and W-accsss in AS j, rspctivly. In addition, lt cr j and cw j b th cost of prforming an R-accss and valuating function Chck, and th cost of prforming a W-accss, rspctivly. Whn a W-accss W i is rqustd, th xcution cost ndd for th proposd W-R chck on s-points is thn qual to (nr j cr j + nw j cw j) j< = n,i j ( h< = sn max E(h) g< = wn i,wn i (g) wn i (g 1) WS i(g) ) cw j. 5. 2 Dtrmination of S-Points This sction prsnts th mthod to dynamically dtrmin th point of tim to sav th stat of D all. Sinc D all is continuously updatd, w nd to chck if th currnt stat of D all has a larg ffct on subsqunt W-R chcks and to dtrmin if stting an s- point. In th following, th way to masur th ffct of ach s- point, i.. th ffct obtaind by D all savd at th s-point is first dscribd and th algorithm to dtrmin if stting an s-point or not is nxt givn. Whnvr a W-accss is rqustd by transaction T i aftr s-point sp(h), th us of D s(h) can rduc j< WSj(wnj(h)) = n,j i writ oprations in th W-R chck for th W-accss. As a consqunc, it is considrd that th ffct obtaind by saving th stat of D all at s-point sp(h) is proportional to th sum of th numbrs of W-accsss in WS i(wn i(h)) s with 1 < = i < = n. W dfin E(h) of a s-point sp(h) as follows: If h =1, E(h) = WS i(wn i(h)). i< = n Othrwis, E(h) = WS i(wn i(h)). i< = n,wn i (h) wn i (h 1) Whn h =1, i.., th s-point is th first on, ffct E(h) is th sum of th numbrs of W-accsss in th rcnt W-squncs of all transactions. On th othr hand, whn h>1, th numbr of W-accsss in WS i(wn i(h)) is not addd to E(h) if wn i(h) = wn i(h 1). In that cas, th W-R chck against RS i(wn i(h)) can b prformd using ithr D s(h) or D s(h 1). Thus w add

Tim t 1 Tim t 2 Tim t 3 Tim t 4 T 1 RS 1 (0) WS 1 RS 1 WS 1 (2) Fig. 8 T 2 RS 2 (0) WS 2 RS 2 WS 2 (2) RS 2 (2) T 3 RS 3 (0) WS 3 RS 3 Exampl concurrnt transactions. D all D st D D(2) D(3) D(4) WS i(wn i(h)) to th ffct of th prvious s-point, and not add to E(h) to prvnt rdundancy. In addition, w also dfin th rducd ffct, E (h), by dlting s-point sp(h). For ach s-point sp(h), E (h) is computd as follows: Initially, E (h) =E(h). For ach T i, If sp(h) is not th latst, (wn i(h) =wn i(h +1)), and ((h =1)or(wn i(h) wn i(h 1))), thn rduc WS i(wn i(h)) from E (h). Whn dlting sp(h), WS i(wn i(h)) is thn addd to E(h +1). (2) If sp(h) is th latst s-point and (wn i(h) =wn i), thn rduc WS i(wn i(h)) from E (h). Whn dlting sp(h), WS i (wn i(h)) is thn addd to th ffct of a nw s-point. Using ffcts E(h) and E (h) as th critria, a nw s-point is st if its ffct is largr than th prvious s-point having th minimum valu, E min,ofe (h)(1 < = h < = sn max). In th following, sp min dnots th prvious s-point having E min. W prsnt th proposd mthod that dtrmins sn max s-points that provid larg ffcts. Right bfor D all is updatd by W- accsss in a nw W-squnc, th proposd dtrmination of an s-point is prformd as follows: Calculat th incrasd ffct, E +, by stting a nw s- point for saving th currnt stat of D all. (2) If sn, i.., th currnt numbr of s-points is lss than sn max, st a nw s-point and its ffct E +. (3) Othrwis, compar E + with E min. Iff E+ is largr than E min, dlt s-point spmin and st a nw s-point sp(snmax). If sp min is not th latst s-point, ffct E(sn max) of th nw s-point is qual to E +. Othrwis, E(sn max) = E + + (= E(sp min) E min ) whr is th ffct addd to th nxt s-point whn s-point sp min i dltd. Th psudo cod of th proposd algorithm to dtrmin s-points is shown in Appndix C. Stps 1, 2, and 3 in Appndix C corrspond to parts, (2), and (3) of th abov xplanation, rspctivly. Sinc a nw s-point is always st only whn th incrasd ffct by th nw s-point is largr than th minimum ffct dcrasd by dlting a prvious s-point, th s-point schdul by th proposd algorithm is optimal undr th givn tim-ordrd writ squncs of transactions. Exampl 3 W illustratd th dtrmination of s-points for th xampl transactions shown in Fig. 8. In Fig. 8, ach tims t 1,t 2,t 3, and t 4 dnot th tims right bfor WS 1, WS 3, WS 2(2), and WS 1(2), rspctivly. Documnt D(i) with 1 < = i < = 4 dnots th stat of D all at tim t i. Assum sn max=2. In Fig. 9, w show th schduling of s-points at ach tim t i(1 < = i < = 4) and th information of s-points, i.. wn i(h) for ach transaction T i(1 < = i < = 3), at tim t 1 sp(h) wn 1 (h) wn 2 (h) wn 3 (h) E(h) E (h) D s(h) sp 0 1 0 1 - D (2) at tim t 2 sp(h) wn 1 (h) wn 2 (h) wn 3 (h) E(h) E (h) D s(h) sp 0 1 0 1 0 D sp(2) 1 1 0 3 - D(2) (3) at tim t 3 sp(h) wn 1 (h) wn 2 (h) wn 3 (h) E(h) E (h) D s(h) sp 0 1 0 1 0 D sp 1 1 0 4 0 D(2) sp(2) 1 1 1 2 - D(3) (4) at tim t 4 sp(h) wn 1 (h) wn 2 (h) wn 3 (h) E(h) E (h) D s(h) sp 1 1 0 4 0 D(2) sp 1 1 1 6 1 D(3) sp(2) 1 2 1 2 - D(4) mans that th rducd ffct is not dtrmind yt. Fig. 9 An xampl s-point schdul. ffct E(h), and D s(h) savd at s-point sp(h). At tims t 1 and t 2, s-points ar st bcaus two(=sn max) s-points can b st. Whn th first s-point sp is st, D is savd as D s and ffct E is 1(=wn 1+wn 2+wn 3), as shown in Fig. 9. As shown in Fig. 9(2), whn th scond s-point sp(2) is st, D(2) is savd as D s(2). Effct E(2) quals to 3(=wn 1(2)) sinc wn 2 = wn 2(2) and wn 3 = wn 3(2). At tim t 3, th numbr of s-points quals to sn max, and thus it is ncssary to dtrmin whthr a nw s-point is st and s-point sp min(= sp) is dltd. Effct E rducd by dlting sp quals to 0 sinc wn 2 is addd to ffct E(2) of s-point sp(2) whn dlting sp. Effct E + (= 2) incrasd by stting a nw s-point is largr than E min (= E ), and thus a nw s-point is st as shown in Fig. 9(3). At tim t 4, s-point sp min is sp and ffct E quals to 0. Effct E + (= 2) incrasd by stting a nw s-point is largr than E, and thus a nw s-point is st as shown in Fig. 9(4). 6. Conclusion In this papr, w proposd a nw locking mthod guaranting srializability which supports gnral XML documnts and full XPath Qury. Th proposd mthod rsolvs th phantom problm by adopting a logical locking approach and achivs high concurrncy by producing locking at th lvl of prcis data in XML documnts. In th proposd mthod, locks ar st on XPath xprssions usd in transaction accsss and conflicts btwn th XPath xprssions and th updats by diffrnt transactions ar chckd to nsur srializability. To dtct conflicts fficintly, w introducd a nw data managmnt modl, which handls two vrsions of a documnt: documnt D i in which updats by ach transaction T i ar rflctd and documnt D all in which updats by all transactions ar rflctd. Undr our data managmnt modl, conflict chcks ar prformd basd on XPath valuation. As for th rad-writ chck whn a transaction T i rqusts a rad accss, XPath xprssion usd in th rad accss is valuatd on documnts D i and D all and th quivalnc of nods in both documnts which ar rachabl by th xprssion is chckd. As for th writ-rad chck, prvious stats of D all savd at s-points ar usd. A dynamic algorithm to dtrmin s-points providing larg ffcts on subsqunt writrad chcks was also proposd and th proposd s-point schdul was shown to b always optimal in trms of th ffct. To valuat th proposd algorithms for th rad-writ chck and th writ-rad chck, w prformd th qualitativ analysis of computing costs and

confirmd th ffctivnss. Th implmntation of th proposd mthod and th quantitativ analysis of xcution tims and mmory sizs ndd for th proposd locking should b includd in futur works. Rfrnc [1] R. Bourrt, XML and databass, Intrnt Documnt, Fbruary 2002, http://www.rpbourrt.com/xml/ XMLAndDatabass.htm. [2] T. Bray, J. Paoli and C. M. Sprbrg-McQun, Extnsibl markup languag (XML) 1.0., W3C Rcommndation, Fbruary 1998, http://www.w3.org/xml. [3] S. Boag, D. Chambrlin, M. F. Frnandz, D. Florscu, J. Robi and J. Simon, XQury 1.0: An XML Qury Languag, W3C Working Draft, August 2002, http://www.w3.org/xml/qury. [4] J. Clark and S. DRos, XML Path Languag (XPath) 1.0., W3C Rcommndation, Novmbr 1999, http://www.w3.org/tr/ xpath. [5] K. P. Eswaran, J. Gray, R. Lori and I. Traigr, Th notions of consistncy and prdicat locks in a databas systms, Comm. of ACM, Vol. 19, No. 11, pp. 624 633, Novmbr 1976. [6] T. Grabs, K. Böhmd and H. Schk, XMLTM: fficint transaction managmnt for XML documnts, Proc. of th 19th CIKM Confrnc, pp. 142 152, 2002. [7] P. Gray and A. Rutr, Transaction procssing: concpts and tchnology, Morgan Kaufmann, 1993. [8] J. R. Jordan, J. Banrj and R. B. Batman, Prcision locks, Proc. of ACM SIGMOD Intrnational Confrnc on Managmnt of Data, pp. 143 147, April 1981. [9] D. B. Lomt, Ky rang locking stratgis for improvd concurrncy, Proc. of th 19th VLDB Confrnc, pp. 655 664, 1993. [10] P. Wadlr, Two smantics for XPath, Tchnical rport, January 2000, http://www.rsarch.avayalabs.com/usr/ wadlr/paprs/xpath-smantics. Appndix A. Smantics of XPath [10] S : Axis P attrn Nod St(Nod) S a [p 1 p 2 ]x = S a [p 1 ]x S a [p 2 ]x S a [/p]x = S a [p] (root(x)) S a [p 1 /p 2 ]x = {x 2 x 1 S a [p 1 ]x, x 2 S a [p 2 ]x 1 } S a [a 1 :: p 1 ]x = S a 1 [p 1 ]x S a [n]x = {x 1 x 1 A[a ]x, nodtyp(x 1 )=P[a], nam(x 1 )=n}nam(x 1 )=n} S a [*]x = {x 1 x 1 A[a ]x, nodtyp(x 1 )=P[a]} S a [txt()]x = {x 1 x 1 A[a ]x, nodtyp(x 1 )=Txt} S a [p[q]]x = lt S 1 = S a [p]x in lt n = siz(s 1 ) in {x 1 x 1 S 1 lt j = siz({x 2 x 2 S 1,x 2 < =doc x 1 }) in lt k =(if D [a ] = forward thn j ls n +1 j) in Q[q ] (x 1,k,n)} Q : Qualifir (Nod,Numbr,Numbr) Boolan Q[q 1 and q 2 ] = Q[q 1 ] (x, k, n) Q[q 2 ] (x, k, n) Q[q 1 or q 2 ] = Q[q 1 ] (x, k, n) Q[q 2 ] (x, k, n) Q[not(q)] = Q[q ] (x, k, n) Q[p] (x, k, n) = S child [p]x = Q[ 1 = 2 ] (x, k, n) = E [ 1 ] (x, k, n) =E [ 2 ] (x, k, n) E : Expr (Nod,Numbr,Numbr) Numbr E [ 1 + 2 ] (x, k, n) = E [ 1 ] (x, k, n) +E [ 2 ] (x, k, n) E [ 1 * 2 ] (x, k, n) = E [ 1 ] (x, k, n) E[ 2 ] (x, k, n) E [position()](x, k, n) = k E [last()](x, k, n) = n E [i] (x, k, n) = i B. Algorithm for th writ-rad chck basd on s-points /* Stp 1: initialization */ W i := th rqustd W-accss by T i D := D st; D i := GtD(D i,w i ); /* Stp 2: th W-R chck for th first R-squnc */ For ach T j with j = i and 1 < = j < = n l nd := 0; IF (sn =0) Thn l nd := wn j Els IF (wn j = 0) l nd := wn j 1; For (l := 0 to l nd ; l := l +1) For ach R-accss R j in RS j (l) IF Chck(D, Mrg(D i,d),r j ) = ok Thn Add dg (T j T i ) to th wait-for graph; Chck dadlock; Exit; IF (l = l nd ) Thn For ach W-accss W j in WS j (l +1) D := GtD(D,W j ); /* Stp 3: th W-R chck basd on s-points */ For (h := 1 to sn; h := h +1) For ach T j with j = i and 1 < = j < = n IF ((h =1)or(wn j (h) = wn j (h 1))) Thn IF (h = sn) Thn l nd := wn j Els IF (wn j (h) =wn j (h +1)) Thn l nd := wn j (h) Els l nd := wn j (h +1) 1; D := D s(h); For (l := wn j (h) to l nd ; l := l +1) For ach R-accss R j in RS j (l) IF Chck(D,Mrg(D, D i ),R j) = ok Thn Add dg (T j T i ) to th wait-for graph; Chck dadlock, Exit; ; IF (l = l nd )) Thn For ach W-accss W j in WS j (l +1) D := GtD(D,W j ); ; C. Algorithm for th dtrmination of s-points E min := th minimum valu of E (h) with 1 < = h < = sn; sp(m) :=sp min, i.. th s-point having E min; For ach T i with 1 < = i < = n wn i (0) := 0; WS(wn i (0)) := 0; /* initialization */ /* Stp 1: computing ffct E + incrasd by a nw s-point and ffct E rducd by dlting th latst s-point */ E + := 0; IF (sn > 0) E := E(sn); For ach T i with 1 < = i < = n IF (wn i (sn) = wn i ) Thn E + := E + + WS i (wn i ) Els IF ((sn =1)or((sn > 1) and (wn i (sn) = wn i (sn 1))) E := E WS i (wn i ) ; /* Stp 2: stting a nw s-point */ IF (sn < sn max) Thn sn := sn +1; For ach T i with 1 < = i < = n wn i (sn) :=wn i ; E(sn) :=E + ; /* st th ffct of nw s-point sp(sn) */ D s(sn) :=D all ; /* sav th currnt stat of D all */ /* st th rducd ffct by dlting th prvious s-point */ IF (sn > 1) E (sn 1) := E ; IF ((sn =1)or(E (sn 1) <E min)) Thn /* dtrmin sp min */ E min := E (sn 1); m := sn 1; /* Stp 3: comparing a nw s-point with sp min */ Els /* dtrmining sp min */ IF (E <E min) Thn E min := E ; m := sn; Els E (sn) :=E ; /* stting a nw s-point and dlting sp min */ IF (E + >E min) Thn /* rcalculat th ffct */ IF (E(m) E min > 0) IF (sp min = sp(sn)) Thn E + := E + +(E(m) E min) Els E(m +1):=E(m +1)+(E(m) E min); /* dlt sp min */ For (h := m +1to sn max; h := h +1) Rplac sp(h) to sp(h 1); /* st nw s-point sp(sn) */ IF (m <sn) Thn E (m) :=E(m); IF (m >1) Thn E (m 1) := E(m 1); For ach T i with 1 < = i < = n wn i (sn) :=wn i ; IF ((m <sn) and (wn i (m) =wn i (m +1))) IF ((m =1)or(wn i (m) = wn i (m 1))) Thn E (m) :=E (m) WS i (wn i (m)) ; IF ((m >1) and (wn i (m 1) = wn i (m))) IF ((m >2) and (wn i (m 1) = wn i (m 2))) Thn E (m 1) := E (m 1) WS i (wn i (m 1)) ; E(sn) :=E + ; /* st th ffct of a nw s-point */ D s(sn) :=D all ; /* sav th currnt stat of D all */