Modeling a Concurrency Control Mechanism in Distributed Databases using Hierarchical Colored Petri Net Saeid Pashazadeh Department of Information Technology Faculty of Electrical and Computer Engineering, University of Tabriz, Tabriz, Iran E-mail: pashazadeh@tabrizu.ac.ir Abstract. Formal methods are widely used for studying and verifying characteristics of concurrency control mechanisms (CCMs) and protocols in distributed databases. Colored Petri net (CPN) has high modeling capabilities and is one of the best methods for formal analysis and verification of CCMs. In this paper, a novel model of CCM based on two phase locking (2PL) using CPN has presented. State space analysis of model permits us to prove that all schedules of concurrent execution of transactions using 2PL in a case study is deadlock free nor not. Then a simple case study along with its state space analysis has presented. Results show that CPN is proper method for modeling CCM using 2PL and proving deadlock freeness property of all schedules of transactions. Keywords: Concurrency control mechanism, Verification, Colored Petri net, State space analysis, Two phase locking 1. Introduction Concurrent execution of transactions in distributed databases faces with a lot of problems. CCM is used for isolation and noninterference execution among conflicting transactions to preserve database consistency through consistency preserving execution of transactions. Access of concurrent trasactions to shared data requires locking. But simple locking and unlocking of shared data do not guarantee the serializability of transactions [1]. 2PL protocol is one of the well known locking protocols that enforce conflict serializabilty. 2PL has two phases, locking and unlocking phases. In 2PL scheduling all locking operations of transactions must precede their first unlock operation. But 2PL may cause the deadlock. Conservative 2PL is one of the extensions of 2PL which prevents deadlock in expense of decreasing the concurrency level. Formal modeling of CCMs is useful in studying different characteristics of them. 2. Related Works Petri nets are formal methods that benefits from easy graphical user interface. Using extended place/transition nets is done for performance evaluation study on distributed database CCMs [2]. Modeling two phase commit protocol for transaction management in distributed environment is studied using time Petri net [3]. Formal specification for concurrency control of database transactions using conventional Petri net based on 2PL protocol which can ensure the serialization of concurrency scheduling is also studied [4]. Quantitative performance study of 2PL in parallel database systems is performed using a novel simulation- based methodology [5]. Standard 2PL and the primary-copy methods are modeled using high level Petri net (colored Petri net) too [6]. In this paper a new model of concurrency control based on the 2PL is introduced using colored Petri net. 3. Colour Sets, Initial Markings and Models of The System 2012 International Conference on Information and Computer Applications (ICICA 2012) IPCSIT vol. 24 (2012) © (2012) IACSIT Press, Singapore 286