Automated Insertion of Exception Handling for Key and Referential Constraints

  • Authors:
  • Kaiping Liu;Hee Beng Kuan Tan;Xu Chen

  • Affiliations:
  • School of Electrical and Electronic Engineering, Nanyang Technological University, Singapore;School of Electrical and Electronic Engineering, Nanyang Technological University, Singapore;Institute of Computing Technology, Chinese Academy of Sciences, Beijing, China

  • Venue:
  • Journal of Database Management
  • Year:
  • 2013

Quantified Score

Hi-index 0.00

Visualization

Abstract

Key and referential constraints are two main integrity constraints in database applications. These constraints can be automatically enforced by the Database Management System with their exception-violation from these constraints-handled by programmers. This paper proposes an approach to relieve the burden of programmers from mechanical coding for handling exceptions of these constraints violation by using program transformation. We first propose an extended abstract syntax tree to include SQL query semantics. Based on it, each code pattern that requires exception handling together with the exception handling code to be inserted is represented as a transformation rule. We provide two alternatives to handle the exceptions: one is to handle the exceptions in conjunction with the built-in enforcement feature in Database Management System; the other is handling them without using the feature provided in Database Management System. Hence, two types of transformation rules are provided accordingly. A tool GEHPHP Generation of Exception Handling for PHP Systems has been developed to implement the proposed approach. Experiments have also been conducted to evaluate the applicable of the approach.