Survey
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
US006584476B1 (12) United States Patent (10) Patent N0.: US 6,584,476 B1 (45) Date of Patent: Jun. 24, 2003 Chatterjee et al. (54) SYSTEM AND METHOD FOR ENFORCING REEERENTIAL CONSTRAINTS BETWEEN VERSIONED DATABASE TABLES 5,873,075 A * 6,351,753 B1 * 6,457,017 B2 * 2/1999 Cochrane et a1. ............ .. 707/2 2/2002 Jagadish et a1. .......... .. 707/200 9/2002 Watkins et a1. ....... .. 707/103 R (75) Inventors: Ramkrishna Chatterjee, Nashua, NH * cited by examiner (US); Ramesh Vasudevan, Burlington, MA (US); Gopalan Arun, Nashua, NH _ (Us); David M01‘, Bedford, NH (Us) (73) Assrgnee: gjrgcle C0rp., Redwood Shores, CA * _ _ _ ( ) Nonce' (21) - (52) (58) _ (57) _ _ ABSTRACT A version control system is described for use in connection Sub]eCt_tO any dlsclalmeri the term of thls With a database management system to facilitate versioning Patent 15 extended or adlusted under 35 of a database table, the system including a database table and U'S'C' 154(k)) by 0 days‘ a version control module. The database table comprises a plurality of records, each record including at least one data ?eld for storing user data and at least some of the records Appl- NOJ 09/557,592 _ including a version control ?eld including version control (22) Flled' (51) _ _ Primary Exammer—Alford Kindred (74) Attorney, Agent, or Firm—Ditthavong & Carlson, PC. Apr‘ 22’ 2000 information. The version control module is con?gured to, in Int. Cl.7 ......................... .. G06F 12/00; G06F 9/44; response to a user query related to the database table and G06F 15/00 US. Cl. ..................... .. 707/203; 715/509; 715/511; 717/170 Field of Search ............................... .. 707/1—5, 203, related to a version, generate an augmented query for processing by the data base management system, the aug mented query relating to the user query and the version Control information The Version Control module facilitates 7075011, 511; 717/101, 120, 170; 715/509, association of versions of the database With respective ones 511 of a hierarchy of states and alloWs con?icts therebetWeen to (56) be resolved, data to be posted from child states to respective parent states in the hierarchy, and referential constraints betWeen tables to be preserved. References Cited U.S. PATENT DOCUMENTS 5,546,576 A * 8/1996 Cochrane et al. ............ .. 707/2 USER \ 9 Claims, 19 Drawing Sheets USER I I I I USER X / VERSION TREE / STORE 15 VERSION CONTROL SUBSYSTEM 11 10 \ A STATE INFO STORE 16 " DATABASE MANAGEMENT SYSTEM 12 I _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ I I I : DATABASE DATABASE I TABLE TABLE | 1 3A 135 DATABASE I I I I _ _ _ I l l l I | TABLE I 13N : 1 . I I l I U.S. Patent Jun. 24, 2003 mZO_wtm.> m?mMOPm mw D H m w: m wD Sheet 1 0f 19 US 6,584,476 B1 U.S. Patent Jun. 24, 2003 Sheet 3 0f 19 US 6,584,476 B1 FIG.3 3TVER\lS0IOEN U.S. Patent Jun. 24, 2003 Sheet 4 0f 19 US 6,584,476 B1 F I (i. 4 100. VERSION CONTROL SUBSYSTEM 1 1 RECEIVES A QUERY FROM A USER @1. VERSION CONTROL SUBSYSTEM 11 DETERMINES WHETHER THE QUERY IS TO ENABLE A NEW RECORD TO BE CREATED, TO ENABLE A RECORD TO BE UPDATED, TO ENABLE DATA TO BE RETRIEVED FROM ONE OR MORE RECORDS, OR TO ENABLE A RECORD TO BE DELETED UPDATE RETIIIIEVE RECORD DA‘I'A CREATE NEIN RECORD 102. VERSION CONTROL SUBSYSTEM 11 GENERATES AN AUGMENTED QUERY INCLUDING INFORMATION FROM THE QUERY RECEIVED IN STEP 1 00, A VERSION IDENTIFIER IDENTIFYING THE VERSION WITH WHICH THE USER IS OPERATING, AND A NEXT VERSION IDENTIFIER COMPRISING THE DEFAULT VALUE 103. VERSION CONTROL SUBSYSTEM 11 PROVIDES THE AUGMENTED QUERY TO THE DBMS 12 FOR PROCESSING DELETE A RECORD U.S. Patent Jun. 24, 2003 Sheet 5 0f 19 US 6,584,476 B1 110. VERSION CONTROL SUBSYSTEM 11 GENERATES A QUERY TO ENABLE THE DBMS 12 TO RETRIEVE THE RECORD VERSION FOR WHICH THE RECORD IS TO BE UPDATED 111. VERSION CONTROL SUBSYSTEM 11 RECEIVES THE RECORD VERSION 114. VERSION CONTROL SUBSYSTEM 11 PROVIDES, AS THE VERSION IDENTIFIER FOR THE UPDATED RECORD VERSION, THE VERSION IDENTIFIER FOR THE VERSION THAT THE USER IS USING 16. VERSION CONTROL SUBSYSTEM 11 GENERATES A QUERY TO ENABLE THE DBMS TO CREATE A NEW ROW, INCLUDING DATA FROM THE RECORD VERSION IDENTIFIED IN STEP 112, AS UPDATED BY THE UPDATE DATA IN THE IN THE QUERY RECEIVED IN STEP 100, A VERSION IDENTIFIER AS PROVIDED IN STEP 114 OR 115, AND A NEXT VERSION IDENTIFIER COMPRISING THE EFAULT VALUE 117. VERSION CONTROL SUBSYSTEM 11 PROVIDES THE QUERY TO THE DBMS 12 FOR PROCESSING 18. VERSION CONTROL SUBSYSTEM 11 GENERATES ONE OR MORE QUERIES TO ENABLE THE DBMS 12 TO APPEND THE VERSION IDENTIFIER USED IN STEP 116 TO THE NEXT VERSION FIELD OF THE RECORD VERSION FROM WHICH USER DATA WAS RECEIVED IN STEP 111, AND PROVIDES THE QUERY TO THE DBMS 12 FOR PROCESSING FI A U.S. Patent Jun. 24, 2003 Sheet 6 6f 19 US 6,584,476 B1 120. THE VERSION CONTROL SUBSYSTEM 11 GENERATES ONE OR MORE QUERIES TO ENABLE THE DBMS 12 TO RETRIEVE, FOR EACH RECORD WHICH WOULD SATISFY THE QUERY, DATA FROM THE RECORD VERSION APPROPRIATE TO THE VERSION THAT THE USER IS USING 121. VERSION CONTROL SUBSYSTEM 11 RECEIVES THE DATA FROM THE RECORD VERSION ASSOCIATED WITH EACH RESPECTIVE RECORD 123. VERSION CONTROL SUBSYSTEM 11 PROVIDES THE DATA THEREFROM TO THE USER FI B U.S. Patent Jun. 24, 2003 Sheet 7 0f 19 US 6,584,476 B1 QM 130. VERSION CONTROL SUBSYSTEM 11 GENERATES A QUERY TO ENABLE THE DBMS 12 TO RETRIEVE THE RECORD VERSION FOR WHICH THE RECORD IS TO BE DELETED 131. VERSION CONTROL SUBSYSTEM 11 RECEIVES THE RECORD VERSION 132. VERSION CONTROL SUBSYSTEM 11 DETERMINES WHETHER THE VERSION IDENTIFIER FIELD OF THE RECORD VERSION IDENTIFIES THE VERSION FOR WHICH THE RECORD IS TO BE DELETED 133. VERSION CONTROL SUBSYSTEM 11 GENERATES A QUERY TO ENABLE THE DBMS 12 TO SET THE DELETE FLAG OF THE RECORD VERSION RECEIVED IN STEP 131 AND PROVIDES IT TO THE DBMS 12 FOR PROCESSING 34. VERSION CONTROL SUBSYSTEM 11 GENERATES A QUERY TO ENABLE THE DBMS 12 TO CREATE A NEW RECORD VERSION, INCLUDING USER INFORMATION FROM RECORD VERSION RECEIVED IN STEP 131, A VERSION IDENTIFIER IDENTIFYING THE VERSION FOR WHICH THE RECORD IS TO BE DELETED, THE DEFAULT VALUE FOR THE NEXT VERSION IDENTIFIER FIELD AND THE SET DELETED FLAG. 135. VERSION CONTROL SUBSYSTEM 11 GENERATES A QUERY TO ENABLE THE DBMS 12 TO UPDATE THE RECORD VERSION WHOSE CONTENTS WERE RECEIVED IN STEP 131 TO ADD VERSION IDENTIFIER FOR VERSION FOR WHICH RECORD IS TO BE DELETED TO NEXT VERSION IDENTIFIER FIELD. U.S. Patent Jun. 24, 2003 Sheet 8 0f 19 US 6,584,476 B1 \Qwhim U.S. Patent Jun. 24, 2003 Sheet 9 0f 19 US 6,584,476 B1 150. USER NOTIFIES THE VERSION CONTROL SUBSYSTEM 11 THAT HE OR SHE WISHES TO PERFORM A CONFLICT DETECTION AND RESOLUTION OPERATION IN CONNECTION WITH A VERSION STATE AND ITS PARENT STATE 1. VERSION CONTROL SUBSYSTEM 11 QUERIES THE DBMS 12 TO RETRIEVE ALL RECORD VERSIONS FOR RECORDS THAT ARE MODIFIED (ADDED, UPDATED, DELETED) IN THE CHILD STATE AND THAT ARE MODIFIED IN THE PARENT STATE IN A VERSION THAT WAS CREATED IN THE PARENT STATE AFTER THE CHILD STATE WAS CREATED; IF MULTIPLE RECORD VERSIONS OF THE SAME RECORD SATISFY THE QUERY, THE RECORD VERSION ASSOCIATED WITH THE LAST VERSION IN THE PARENT STATE IS PROVIDED BY THE BMS 12. 52. FOR EACH RECORD FOR WHICH A CONFLICT EXISTS, RECORD VERSIONS FOR (i) THE LATEST VERSION IN THE CHILD STATE, (I) THE LATEST VERSION IN THE PARENT STATE, AND (iii) A BASE VERSION COMPRISING THE LAST VERSION BEFORE THE RECORD WAS MODIFIED IN THE PARENT AND CHILD STATE, ARE PROVIDED TO THE USER. LATEST VERSION IN PARENT STATE 153. FOR A RECORD FOR WHICH A CONFLICT EXISTS, USER SELECTS A RECORD VERSION BASE LATEST VERSIO IN CHILD STATE VERSION 5 we) U.S. Patent Jun. 24, 2003 Sheet 10 0f 19 US 6,584,476 B1 F] @ VERSION CONTROL SUBSYSTEM 11 GENERATES ONE OR MORE QUERIES TO ENABLE THE DBMS 12 TO (i) COPY USER DATA FROM THE RECORD VERSION ASSOCIATED WITH THE CHILD STATE TO RECORD VERSION ASSOCIATED WITH THE LATEST VERSION OF THE PARENT STATE, AND (ii) INSERT THE VERSION IDENTIFIER OF THE LATEST VERSION OF THE CHILD STATE IN THE NEXT VERSION IDENTIFIER FIELD 23 OF THE LATEST VERSION OF THE PARENT STATE, AND PROVIDES THE QUERIES TO THE DBMS FOR ROCESSING 55. VERSION CONTROL SUBSYSTEM 11 GENERATES ONE OR MORE QUERIES TO ENABLE THE DBMS 12 TO STORE A SYNCHRONIZATION VALUE IN THE SYNCHRONIZE FIELD 24 OF THE RECORD VERSIONS ASSOCIATED WITH THE LATEST VERSIONS OF BOTH THE CHILD AND PARENT STATE, THEREBY TO INDICATE THAT THE TWO VERSIONS ARE SYNCHRONIZED 158. VERSION CONTROL SUBSYSTEM 11 DETERMINES WHETHER THERE ARE ANY ADDITIONAL RECORDS FOR WHICH A CONFLICT EXISTS N 159. DONE A U.S. Patent Jun. 24, 2003 Sheet 11 0f 19 US 6,584,476 B1 6 VERSION CONTROL SUBSYSTEM 11 GENERATES ONE OR MORE QUERIES TO ENABLE THE DBMS 12 TO (i) COPY USER DATA FROM THE RECORD VERSION ASSOCIATED WITH THE PARENT STATE TO RECORD VERSION ASSOCIATED WITH THE LATEST VERSION OF THE CHILD STATE, AND (ii) INSERT THE VERSION IDENTIFIER OF THE LATEST VERSION OF THE PARENT STATE IN THE NEXT VERSION IDENTIFIER FIELD 23 OF THE LATEST VERSION OF THE CHILD STATE, AND PROVIDES THE QUERIES TO THE DBMS FOR ROCESSING 57. VERSION CONTROL SUBSYSTEM 11 GENERATES ONE OR MORE QUERIES TO ENABLE THE DBMS 12 TO (I) COPY USER DATA FROM THE BASE RECORD VERSION TO THE RECORD VERSIONS ASSOCIATED WITH THE LATEST VERSION OF BOTH THE PARENT STATE AND THE CHILD STATE THE CHILD STATE, AND (I) INSERT THE VERSION IDENTIFIERS OF THE LATEST VERSIONS OF BOTH THE PARENT AND CHILD STATES IN THE NEXT VERSION IDENTIFIER FIELD 23 OF THE BASE VERSION, AND PROVIDES THE QUERIES TO THE DBMS FOR ROCESSING U.S. Patent Jun. 24, 2003 Sheet 12 0f 19 170. USER NOTIFIES THE VERSION CONTROL SUBSYSTEM 11 THAT A POST OPERATION IS TO BE PERFORMED IN CONNECTION WITH A CHILD STATE AND ITS PARENT STATE 171. VERSION CONTROL SUBSYSTEM 11 PERFORMS A CONFLICT RESOLUTION OPERATION FOR ALL CONFLICTING RECORDS IN LATEST VERSIONS OF PARENT AND CHILD STATES (REFERENCE FIG. 5) 72. VERSION CONTROL SUBSYSTEM 11 GENERATES ONE OR MORE QUERIES TO ENABLE DBMS 12 TO COPY THE USER DATA FROM THE LATEST VERSION OF ALL RECORDS IN THE LATEST VERSION OF THE CHILD STATE WHICH HAVE BEEN MODIFIED SINCE THE LAST POST OPERATION INTO THE LATEST VERSION OF THE PARENT STATE, AND PROVIDES THEM TO THE DBMS 12 FOR ROCESSING 173. VERSION CONTROL SUBSYSTEM 11 GENERATES ONE OR MORE QUERIES TO ENABLE DBMS 12 TO INSERT THE VERSION IDENTIFIER OF THE LATEST VERSION OF CHILD STATE IN RECORD VERSIONS IN WHICH USER DATA WAS COPIED IN STEP 172, AND PROVIDES THEM TO THE DBMS 12 FOR PROCESSING 174. VERSION CONTROL SUBSYSTEM 11 GENERATES ONE OR MORE QUERIES TO ENABLE THE DBMS 12 TO STORE A SYNCHRONIZATION VALUE IN THE SYNCHRONIZE FIELD 24 OF THE RECORD VERSIONS ASSOCIATED WITH THE LATEST VERSIONS OF BOTH THE CHILD AND PARENT STATE, THEREBY TO INDICATE THAT THE TWO VERSIONS ARE SYNCHRONIZED, AND PROVIDES THEM TO THE DBMS 12 FOR PROCESSING 175. VERSION CONTROL SUBSYSTEM 11 STORES LIST OF VERSION IDENTIFIERS OF RECORD VERSIONS IN THE CHILD STATE FROM WHICH DATA WAS COPIED IN STEP 1 72. US 6,584,476 B1 U.S. Patent Jun. 24, 2003 Sheet 13 0f 19 US 6,584,476 B1 180. USER NOTIFIES THE VERSION CONTROL SUBSYSTEM 11 THAT A REFRESH OPERATION IS TO BE PERFORMED IN CONNECTION WITH A CHILD STATE AND ITS PARENT STATE 181. VERSION CONTROL SUBSYSTEM 11 PERFORMS A CONFLICT RESOLUTION OPERATION FOR ALL CONFLICTING RECORDS IN LATEST VERSIONS OF PARENT AND CHILD STATES (REFERENCE FIG. 5) 182. VERSION CONTROL SUBSYSTEM 11 UPDATES VERSION HIERARCHY INFORMATION TO INCLUDE ALL VERSIONS CREATED IN THE PARENT STATE AFTER THE CHILD STATE WAS CREATED IN VERSION HIERARCHY OF CHILD STATE . 83. VERSION CONTROL SUBSYSTEM 11 GENERATES ONE OR MORE QUERIES TO CHAIN EACH RECORD VERSION WHOSE USER DATA WAS POSTED FROM THE CHILD STATE INTO THE PARENT STATE, AS IDENTIFIED BY THE SYNCHRONIZE VALUES IN THEIR SYNCHRONIZE FIELDS 24, BY STORING THE VERSION IDENTIFIER FOR THE CHILD VERSION IN THE NEXT VERSION IDENTIFIER FIELD 23 OF THE RESPECTIVE RECORD VERSION ASSOCIATED WITH THE PARENT STATE. 184. VERSION CONTROL SUBSYSTEM 11 ESTABLISHES NEW CHILD VERSION OF LAST VERSION IN THE PARENT STATE U.S. Patent Jun. 24, 2003 Sheet 14 0f 19 US 6,584,476 B1 00. USER ISSUES A QUERY THAT WOULD ENABLE THE DBMS 12 TO PERFORM AN OPERATION IN CONNECTION WITH A DATABASE TABLE 13n THAT IS OF A TYPE THAT WOULD BE SUBJECT TO A REFERENTIAL INTEGRITY CONSTRAINT 201. VERSION CONTROL SUBSYSTEM 11 DETERMINES WHETHER THE DATABASE TABLE WITH RESPECT TO WHICH THE QUERY IS TO BE PROCESSED HAS A REFERENTIAL INTEGRITY CONSTRAINT IN CONNECTION WITH ANOTHER (PARENT) DATABASE TABLE 202. VERSION CONTROL SUBSYSTEM 11 PROCESSES THE QUERY AS DESCRIBED ABOVE 203. VERSION CONTROL SUBSYSTEM 1 1 DETERMINES WHETHER BOTH CHILD AND PARENT TABLES ARE VERSION-ENABLED ND f 204. VERSION CONTROL SUBSYSTEM 11 DETERMINES WHETHER QUERY IS TO ENABLE AN OPERATION TO BE PERFORMED ON CHILD TABLE 205. VERSION CONTROL SUBSYSTEM 11 DETERMINES WHETHER QUERY IS TO INSERT A NEW ROW OR UPDATE AN EXISTING RECORD VERSION THAT CHANGES VALUE OF "FOREIGN KEY" YES U.S. Patent Jun. 24, 2003 Sheet 15 0f 19 US 6,584,476 B1 206. VERSION CONTROL SUBSYSTEM 11 GENERATES ONE-OR MORE AUGMENTED QUERIES AS NECESSARY TO ENABLE OPERATION TO BE PERFORMED AND PROVIDES THEM TO THE DBMS 12 FOR PROCESSING 07. VERSION CONTROL SUBSYSTEM 11 DETERMINES WHETHER A CORRESPONDING RECORD EXISTS IN THE PARENT TABLE IN A VERSION THAT IS IN THE VERSION HIERARCHY BETWEEN THE ROOT VERSION AND THE VERSION ASSOCIATED WITH THE VERSION BEING USED IN THE CHILD TABLE; IF MULTIPLE RECORD VERSIONS EXIST IN THE VERSION HIERARCHY, THE RECORD VERSION ASSOCIATED WITH THE VERSION IN THE HIERARCHY THAT IS CLOSEST TO THE VERSION BEING USED IN THE CHILD TABLE IS USED. 208. VERSION CONTROL SUBSYSTEM 11 REJECTS THE QUERY 209. VERSION CONTROL SUBSYSTEM 11 GENERATES ONE OR MORE AUGMENTED QUERIES AS NECESSARY TO ENABLE OPERATION TO BE PERFORMED AND PROVIDES THEM TO THE DBMS 12 FOR PROCESSING FI A U.S. Patent Jun. 24, 2003 Sheet 16 0f 19 US 6,584,476 B1 210. VERSION CONTROL SUBSYSTEM 11 DETERMINES WHETHER QUERY IS TO ENABLE A RECORD VERSION THAT IS_ THE REFERENTIAL CONSTRAINT TO BE DELETED, OR A CASCADE DELETE 211. VERSION CONTROL SUBSYSTEM 11 GENERATES ONE OR MORE AUGMENTED QUERIES TO ENABLE DBMS 12 TO DELETE ALL RECORDS IN THE CHILD TABLE THAT ARE DEPENDENT ON THE PARENT TABLE RECORD AND PROVIDES THEM TO THE DBMS 12 FOR PROCESSING 212. VERSION CONTROL SUBSYSTEM 11 GENERATES ONE OR MORE AUGMENTED QUERIES TO ENABLE DBMS 12 TO DELETE RECORD IN THE PARENT TABLE AND PROVIDES THEM TO THE DBMS 12 FOR PROCESSING 213. VERSION CONTROL SUBSYSTEM 11 DETERMINES WHETHER THE QUERY IS TO ENABLE A RESTRICTED DELETE OR AN UPDATE OF A RECORD VERSION 214. VERSION CONTROL SUBSYSTEM 11 GENERATES ONE OR MORE AUGMENTED QUERIES AS NECESSARY TO ENABLE OPERATION TO BE PERFORMED AND PROVIDES THEM TO THE DBMS 12 FOR PROCESSING FI B U.S. Patent Jun. 24, 2003 Sheet 17 0f 19 US 6,584,476 B1 215. VERSION CONTROL SUBSYSTEM 11 DETERMINES WHETHER THERE ARE ANY RECORDS IN THE CHILD TABLE THAT DEPEND ON THE PARENT TABLE RECORD TO BE DELETED OR UPDATED 216. VERSION CONTROL SUBSYSTEM 11 REJECTS OPERATION 217. VERSION CONTROL SUBSYSTEM 11 GENERATES ONE OR MORE AUGMENTED QUERIES AS NECESSARY TO ENABLE OPERATION TO BE PERFORMED AND PROVIDES THEM TO THE DBMS 12 FOR PROCESSING U.S. Patent NO Jun. 24, 2003 Sheet 18 0f 19 US 6,584,476 B1 220. VERSION CONTROL SUBSYSTEM 11 DETERMINES WHETHER CHILD TABLE IS VERSION ENABLEDI BUT PARENT TABLE IS NOT 221. VERSION CONTROL SUBSYSTEM 1 1 DETERMINES WHETHER OPERATION IS TO BE PERFORMED IN CONNECTION WITH CHILD TABLE NO 222. VERSION CONTROL SUBSYSTEM 11 DETERMINES WHETHER QUERY IS TO INSERT A NEW ROW OR UPDATE AN EXISTING RECORD VERSION THAT CHANGES VALUE OF "FOREIGN KEY“ 223. VERSION CONTROL SUBSYSTEM 11 GENERATES ONE OR MORE AUGMENTED QUERIES AS NECESSARY TO ENABLE OPERATION TO BE PERFORMED AND PROVIDES THEM TO THE DBMS 12 FOR PROCESSING 224. VERSION CONTROL SUBSYSTEM 11 DETERMINES WHETHER A CORRESPONDING RECORD EXISTS IN THE PARENT TABLE 225. VERSION CONTROL SUBSYSTEM 11 REJECTS QUERY YES U.S. Patent Jun. 24, 2003 Sheet 19 0f 19 US 6,584,476 B1 226. VERSION CONTROL SUBSYSTEM 11 GENERATES ONE OR MORE AUGMENTED QUERIES AS NECESSARY TO ENABLE OPERATION TO BE PERFORMED AND PROVIDES THEM TO THE DBMS 12 FOR PROCESSING 227. VERSION CONTROL SUBSYSTEM 11 GENERATES ONE OR MORE AUGMENTED QUERIES AS NECESSARY TO ENABLE OPERATION TO BE PERFORMED AND PROVIDES THEM TO THE DBMS 12 FOR PROCESSING FI E