concurrency control in xml databases ali abbasi. concurrency in xml bases xml : standard format of...
DESCRIPTION
XPath XPath models an XML document as a tree of nodes. XPath expressions are used to indicate the requested nodes in the XML tree An Xpath exp : /S 1,j /S 2,j /S 3,j /.../S m,j S i,j : Axis::NodeTest[Predicate]TRANSCRIPT
![Page 1: Concurrency control in XML databases Ali Abbasi. Concurrency in XML Bases XML : standard format of data exchange on the internet XML docs is stored in](https://reader036.vdocuments.site/reader036/viewer/2022082723/5a4d1b3e7f8b9ab05999ff62/html5/thumbnails/1.jpg)
Concurrency control in XML databases
Ali Abbasi
![Page 2: Concurrency control in XML databases Ali Abbasi. Concurrency in XML Bases XML : standard format of data exchange on the internet XML docs is stored in](https://reader036.vdocuments.site/reader036/viewer/2022082723/5a4d1b3e7f8b9ab05999ff62/html5/thumbnails/2.jpg)
Concurrency in XML Bases
XML : standard format of data exchange on the internet
XML docs is stored in databases Concurrency control is an important function of a DB Traditional CC protocols are not tailored to XML
database systems New protocols designed based on different access
methods : DOM, XPath, ...
![Page 3: Concurrency control in XML databases Ali Abbasi. Concurrency in XML Bases XML : standard format of data exchange on the internet XML docs is stored in](https://reader036.vdocuments.site/reader036/viewer/2022082723/5a4d1b3e7f8b9ab05999ff62/html5/thumbnails/3.jpg)
XPath
XPath models an XML document as a tree of nodes. XPath expressions are used to indicate the requested
nodes in the XML tree An Xpath exp : /S1,j /S2,j /S3,j /.../Sm,j
Si,j : Axis::NodeTest[Predicate]
![Page 4: Concurrency control in XML databases Ali Abbasi. Concurrency in XML Bases XML : standard format of data exchange on the internet XML docs is stored in](https://reader036.vdocuments.site/reader036/viewer/2022082723/5a4d1b3e7f8b9ab05999ff62/html5/thumbnails/4.jpg)
Non-conflicting conditions A transaction T is a sequence of pairs of operations Oj(x)
and location path Lj Operations are : pass-by, read, write, insert, delete
For any x,y, <Pi(x),Pj(y)>, <Pi(x),Rj(y)> and <Ri(x),Rj(y)>,
For any x,y, <Ri(x),Ij(y)>, <Wi(x),Ij(y)>
For any y, if there exists a location step S in location path L in Ti such that x is not a member of R(S) and RI(S), <Pi(x),Wj(y)>, <Pi(x),Ij(y)>, <Pi(x),Dj(y)>
![Page 5: Concurrency control in XML databases Ali Abbasi. Concurrency in XML Bases XML : standard format of data exchange on the internet XML docs is stored in](https://reader036.vdocuments.site/reader036/viewer/2022082723/5a4d1b3e7f8b9ab05999ff62/html5/thumbnails/5.jpg)
Conflicting conditions <Ri(x),Wj(x)>, <Ri(x),Dj(x)> <Wi(x),Wj(x)>, <Wi(x),Dj(x)> <Ii(x),Ij(x)>, <Ii(x),Dj(x)>, <Di(x),Dj(x)> For any x, if there exists a location step S in location
path L such that x is a member of R(S) or RI(S), <Pi(x),Wj(x)>, <Pi(x),Ij(x)>, <Pi(x),Dj(x)>
![Page 6: Concurrency control in XML databases Ali Abbasi. Concurrency in XML Bases XML : standard format of data exchange on the internet XML docs is stored in](https://reader036.vdocuments.site/reader036/viewer/2022082723/5a4d1b3e7f8b9ab05999ff62/html5/thumbnails/6.jpg)
XLP XLP is a lock-based protocol with five lock modes,
denoted by P-, R-, W-, I- and D-locks XLP is 2PL Nodes in the M-set of Si,j (M(Si,j) and MI(Si,j)) are all locked
by P-locks before performing the Node-Test and Predicate
Granularity Rules : (1) Lock granularity of P-, R-, I-, or W-locks on a node is
only the node itself. (2) Lock granularity of D-locks on a node includes the whole
subtree rooted at the node.
![Page 7: Concurrency control in XML databases Ali Abbasi. Concurrency in XML Bases XML : standard format of data exchange on the internet XML docs is stored in](https://reader036.vdocuments.site/reader036/viewer/2022082723/5a4d1b3e7f8b9ab05999ff62/html5/thumbnails/7.jpg)
XLP Compatibility Rule.
A particular type of lock on location step Si can be granted as long as the compatibility matrix is respected.
Release Rules R-, W-, I- or D-locks on Nd(Lj) can only be released in the
shrinking phase of a transaction. P-locks on nodes in the set are released only in the
shrinking phase; Other P-locks on are released after location step Si,j
finishes
![Page 8: Concurrency control in XML databases Ali Abbasi. Concurrency in XML Bases XML : standard format of data exchange on the internet XML docs is stored in](https://reader036.vdocuments.site/reader036/viewer/2022082723/5a4d1b3e7f8b9ab05999ff62/html5/thumbnails/8.jpg)
Properties
XLP ensures conflict serializability. XLP outperforms 2PL owing to the earlier release of P-
locks and lower lock conflicts according to its lock compatibility matrix.
XLP fully supports most XPath’s axis operations
phantom problem may exist in some schedules under XLP
![Page 9: Concurrency control in XML databases Ali Abbasi. Concurrency in XML Bases XML : standard format of data exchange on the internet XML docs is stored in](https://reader036.vdocuments.site/reader036/viewer/2022082723/5a4d1b3e7f8b9ab05999ff62/html5/thumbnails/9.jpg)
LWMGL A lock-based CC protocol XML documents have a hierarchical structure Two hierarchical locking protocol: TL, MGL None of them a is an appropriate solution LWMGL is a hybrid of MGL and TL It’s goal is preventing phantoms and providing high
concurrency
![Page 10: Concurrency control in XML databases Ali Abbasi. Concurrency in XML Bases XML : standard format of data exchange on the internet XML docs is stored in](https://reader036.vdocuments.site/reader036/viewer/2022082723/5a4d1b3e7f8b9ab05999ff62/html5/thumbnails/10.jpg)
pseudo-conflict:
T1 retrieves all the /description elements
T2 inserts price element
Pseudo-conflict
![Page 11: Concurrency control in XML databases Ali Abbasi. Concurrency in XML Bases XML : standard format of data exchange on the internet XML docs is stored in](https://reader036.vdocuments.site/reader036/viewer/2022082723/5a4d1b3e7f8b9ab05999ff62/html5/thumbnails/11.jpg)
phantom
T1 retrieves all the elements in /Books/Book
T2 inserts Discount
![Page 12: Concurrency control in XML databases Ali Abbasi. Concurrency in XML Bases XML : standard format of data exchange on the internet XML docs is stored in](https://reader036.vdocuments.site/reader036/viewer/2022082723/5a4d1b3e7f8b9ab05999ff62/html5/thumbnails/12.jpg)
XIET data model The element table schema E has a set of element
records E = {indexing group, elements, rowID} The data table schema D has a set of data records
D = {rowID, TextString} indexing group I = {G,S,D}
![Page 13: Concurrency control in XML databases Ali Abbasi. Concurrency in XML Bases XML : standard format of data exchange on the internet XML docs is stored in](https://reader036.vdocuments.site/reader036/viewer/2022082723/5a4d1b3e7f8b9ab05999ff62/html5/thumbnails/13.jpg)
LWMGL Protocol
Find the target element by using GSD indices Acquire S_locks for reading each element where the
target element traverses subelements Acquire X_locks on the leaf element in order to update
the value in the data table Acquire IX_lock on the parent for inserting a node for
prohibiting phantom
![Page 14: Concurrency control in XML databases Ali Abbasi. Concurrency in XML Bases XML : standard format of data exchange on the internet XML docs is stored in](https://reader036.vdocuments.site/reader036/viewer/2022082723/5a4d1b3e7f8b9ab05999ff62/html5/thumbnails/14.jpg)
LWMGL Protocol
Acquire IX locks from the root element to target element in order to delete an element in the element table so as to prohibit parent element deletion from other transactions during deletion.
Follow the order in locking from the parent element of the subelements to their child. In an unlocking fashion, follow it in the opposite direction, i.e., from the child element to the parent of the subelements.
![Page 15: Concurrency control in XML databases Ali Abbasi. Concurrency in XML Bases XML : standard format of data exchange on the internet XML docs is stored in](https://reader036.vdocuments.site/reader036/viewer/2022082723/5a4d1b3e7f8b9ab05999ff62/html5/thumbnails/15.jpg)
References Kuen-Fang Jea, Shih-Ying Chen, A High concurrency XPath-based
locking protocol for XML Databases, In: Elsevier Science ,2005.
Yonggoo Choi, Songchum Moon, Lightweight multigranularity locking for transaction management in XML database systems, In: Elsevier Science ,2005.
Grabs, T., Bo¨hm, K., Schek, H.-J., XMLTM: efficient transaction management for XML documents. In: Proceedings of the ACM International Conference on Information and Knowledge Management, CIKM 2002
![Page 16: Concurrency control in XML databases Ali Abbasi. Concurrency in XML Bases XML : standard format of data exchange on the internet XML docs is stored in](https://reader036.vdocuments.site/reader036/viewer/2022082723/5a4d1b3e7f8b9ab05999ff62/html5/thumbnails/16.jpg)
L :/child::a/descendant::d[position()=2] M(S1,1)=R (S1,1)= {a} , MI(S1,1) and RI(S1,1) are empty MI(S2,1)={b2, b3, c1, c2} , M(S2,1)={d1, d2, d3} RI(S2,1)={b2, c1} , R(S2,1)={d2}.