A New Transacton Processng Model Based on Optmstc Concurrency Control Wang Pedong,Duan Xpng,Jr. Abstract-- In ths paper, to support moblty and dsconnecton of moble clents effectvely n moble computng envronment, a moble transacton processng model based on optmstc concurrency control s provded. The model s descrbed n the follow aspects, that s handlng process of moble transacton, concurrency control and resoluton strategy. The analyss and experment present that ths model s more adaptable to moble computng envronment. Index Terms---concurrency control, moble database, moble transacton I. INTRODUCTION OBILE computng system has changed the hypothess M condton of tradtonal dstrbuted computng system. Therefore, technologes of tradtonal dstrbuted database can not be appled n moble computng envronment drectly. It s needed to research newly. Moble transacton processng s a crtcal technology of moble database and s used to sustan the consstency of data, support concurrency accesses of multple users and make users select and update database relably. Moble transacton processng s more complex than the transacton processng of tradtonal database system, and users demand hgher autonomy, to local database. In the desgnng process of moble transacton processng, t s needed to consder the lmtatons of moble computng envronment and moble transacton tself, and to provde the support to dsconnecton of moble clents. A lot of models of moble transacton processng have been provded. Some models (for example, Kangroo model[]) gve and take or defne newly the ACID attrbutes of transactons and relax the lmtaton to ACID rules. Therefore these models cannot assure the full seralzaton of transactons and the consstency of database. O2PL-MT model[2] provdes a more flexble sendng mode of moble transacton, but the shortage s that clents can not depart the current network before operatng serals return results, and data may be locked for a long tme due to adoptng 2PL, therefore reduces the concurrency of transacton processng of server. O2PC_MT model[3] overcomes the shortages of O2PL-MT model, but the response F. Wang Pedong (953- ), male, professor, works n department of Computer Scence and Technology n Harbn Unversty of Scence and Technology, Harbn, Chna. The man study drectons are parallel processng and control technology and embedded applcatons. (telephone: 045-86870702, e-mal: wpdlg@ 63.com). S. Duan Xpng (980- ), female, assstant, works n department of computer scence n Harbn Normal Unversty, Harbn, Chna. The man study drecton s moble database. (e-mal: xpduan@26.com). speed s not hgh to the transactons sent by applcaton n clents. II. PRESENTATION OF MOBILE TRANSACTION MODEL A. Model Mechansm A typcal moble computng envronment model s showed n [4], based on whch a moble transacton processng model showed n fgure s proved n ths paper. In the model, LTM s the abbrevaton of local transacton manager, MTC s the abbrevaton of moble transacton manager on the coordnator, MTP s the abbrevaton of Moble transacton manager on the partcpator and LDB s the abbrevaton of Local database. The moble support staton ( MSS ) and the fxed host are on the same host; thus, relatvely, the structure s smple. Dotted ellpses express wreless regons controlled by MSSs. Dotted two-way arrows denote cross-regon movng. The process of transacton processng can be dvded nto connecton and dsconnecton modes due to exstng of dsconnecton. In the model, MTCs need to process transacton transfers due to cross-regon movng; therefore, t s more complex relevantly. LDB cell APPL APPL APPL APPL LTM MTC MH MH cell2 LTM MTC MSS MSS E E2 E3 E4 E5 E6 MTP MTP MTP MTP MTP LDB LDB LDB LDB LDB Fg. Moble transacton processng model LDB B. The Processng of Moble Transacton a) Transacton processng n dsconnecton mode. Dsconnecton mode Moble computers always dsconnect due to the low bandwdth, hgh lag and weak connecton of moble computng envronment. Dsconnecton should not be handled as falure, 505
whch s dstngushed from tradtonal concepts. Generally, dsconnectons can be dvded nto two types: actve dsconnecton and passve dsconnecton. Actve dsconnecton s ths knd of dsconnecton that consders the lmtaton of clents and protectng resource, and s sent by users. Passve dsconnecton s determned by network state, whch accord wth the characterstcs of wreless network. Under ths condton, the system should assure avalablty and support transacton processng under dsconnecton condtons. 2. Executve process of moble transactons () MHs send moble transactons MTs; (2) On MHs, LTMs compute locally usng data n wrte set or buffer, and record the operatng process nto log; (3) If the state of network s well, organze log nformaton and multple verson lnk to UTQ and send t to the server; (4) The MTC receves UTQ, and after that, checks the status ' table of MHs to get the correspondng coordnator MTC. If ' there s no coordnator or the MTC s dentcal wth MTC, then that s to say the current MTC s the source coordnator of the MH whch has sent the transacton request, then swtch to the 5 th ' step. Otherwse, send the requests to MTC drectly; (5) The MTC dstrbutes unque transacton ID(MTID) to every transacton, then establsh an entry n transacton status table, and record BTMT nto transacton log to handle every transacton; (6) The MTC sends all the transacton nformaton to each MTP; (7) Each MTP receves transacton nformaton sent by MTC. If the nformaton s receved normally, then every MTP sends normal message to MTC. Otherwse, every MTP sends Abort or nothng; (8) If all the MTPs send normal message to MTC, then MTC sends prepare MT message to every MTP; (9) Every MTP organzes sub-transacton nformaton of all the transactons, add exclusve locks to all the data n wrte set, and add shared locks to all the data n read set, then count the readable set of every sub-transacton and valdate sub-transacton of every transacton. To every sub-transacton, f t s permtted to commt, then the MTP sends ready MT to MTC. Otherwse, the MTP send Abort or nothng to the MTC; (0) To every moble transacton, the MTC receves the answer of every MTP. If all the answers are ready MT, then the MTC send Global commt to every MTP, otherwse send Global Abort ; () The MTP receves the command from the MTC, f t s Global Commt, then adds the sub-transacton nto Commtset, add wrtesset nto CommtWSet, then absorbs the WrteSet nto ts ReadableSet to get the ReadableSet of next sub-transacton and sends message to the MTC. Otherwse, delete the data from the WrteSet of the sub-transacton to get the ReadableSet of next sub-transacton and sends message to the MTC accordng to the condton; (2) After all the sub-transactons have been handled, the MTP absorbs ResultSets of transactons n CommtSet nto database, consequently complete updatng; (3) The MTC wats for the answer of every MTP, receves the returned message and sends the results back to MH. b) Moble transacton handlng of connecton mode. Connecton mode Connecton mode refers to the state that moble clents connect wth servers va MSSs. Under ths condton, the whole moble database system can be regarded as a dstrbuted database system and tradtonal dstrbuted transacton handlng strateges can be used. But what should be noted s that the system does not equate tradtonal dstrbuted system under ths condton, whch attrbutes to the low bandwdth and weak connecton of wreless network. Adoptng tradtonal strategy must cause the low response speed to applcatons n clents and cause poor usablty. Therefore, t s necessary to recast the tradtonal strateges. 2. Transacton processng What s dfferent from the dsconnecton mode s that n connecton mode, once a transacton has been handled n the 506
moble clent, the transacton s sent to the server ste to be valdated. That s n the UTQ, there s only one transacton. C. Optmstc concurrency control strategy The basc dea of optmstc concurrency control s that let transactons execute freely and not check the conflcts untl commtment. If there s a conflct, then restart the transacton. To assure the atomcty of transactons, all the updatng operatons effect on the local copy, and the results are wrtten nto database when the transacton commt. The three phases of optmstc transacton executon are read phase, valdaton phase and wrte phase. Among them, read phase and wrte phase are not specfc, only temporarly commt when execute, and not wrte physcally and the result can be seen by other transactons. Therefore among the three phases, valdaton phase s the phase need to be consdered especally. D. Resoluton process In the process of executon of moble transactons on clents, there s ordnary transactons execute on servers at the same tme, whch certanly wll cause conflctons. Therefore to assure the consstency of database, t s needed to check the potental conflcton between the transacton and other transactons before t commts. In order to valdate the moble transacton after the MTC receved t, at the frst organzes the transacton nformaton nto sub-transactons, then sends them to every MTP. The MTP checks that f the data n the ReadSet of the sub-transacton have been modfed. If not, then the sub-transacton can be commtted, and the MTP sends successful message. Otherwse sends falng message. The concrete procedure s to compare every datum n ReadSet. If all the data of the sub-transacton have not been modfed, then t passes valdaton, otherwse doesn t pass valdaton. After all the transactons n UTQ have been handled, the ResultSets of the transactons whch have past valdaton are absorbed nto database all together. Suppose that there are n transactons n the receved UTQ whch s beng processed by the MTC at the current, named MT ( n). The MTC sends the ReadSet, the WrteSet and ResultSet of every transacton to the correspondng MTPs accordng to data dstrbuton. Consequently, the relevant sub-transacton queue s organzed on every MTP. Every sub-transacton whch s noted as MT ( n, m ) represents the sub-transacton of the NO. moble transacton on the NO. MTP. Defnton (ReadSet of transacton) To every transacton T, ts ReadSet s composed of all the data read by t. Defnton 2 (WrteSet of transacton) To every transacton T, ts WrteSet s composed of all the data wrtten by t. Defnton 3 (ResultSet of transacton) ResultSet of transacton s composed of values of all the data when t commt. Defnton 4 l( Loc, T, X ) represents the value of the data at the tme T and locaton Loc. Defnton 5 (ReadableSet) Suppose that MT ( n, m) s a sub-transacton of sub-transacton queue watng for valdaton on NO. MTP, whle ts correspondng moble transacton MT begns to execute on the MH at the tme t and t s valdated on the NO. MTP at the tme T, then the defnton of ReadableSet of sub-transacton MT s as follows. Re adableset ( MT ) = ( X ( X Re adableset ( MT ) = { X ( X ( l ( MH, t, X ) = l( FH, T, X )) U n = In the followng, the valdaton algorthm of sub-transactons on No. MTP wll be gven. Input all the sub-transacton nformaton // Lock the data related wth the every sub-transacton MT ( n ) ReadableSet=CommtSet=CommtWSet=φ ; n for(all X U(Re adset( MT ) UWrteSet( = MT ( )) ) 507
{f ( X U n ( WrteSet( = XLock( X ); else SLock( X ); MT )) ) f (PVN( X, MH)==PVN( X, FH)) ReadableSet=Readableset U { X ; //conflct detecton for( =; <= UTQ ; ++) {f(readset( MT ) ReadableSet) Send ready MT to MTC; else Send Abort or nothng to MTC; f (the receved message from MTC s Global commt ) {CommtSet=CommtSet U { MT ; CommtWSet=CommtWSet U WrteSet( MT ); ReadableSet=ReadableSet U WrteSet( MT ); else ReadableSet=ReadableSet-WrteSet( MT); Unlock All Slock; //Absorb the ResultSet of all the sub-transacton n CommtSet nto database for ( all X CommtWSet) { MT =(the last sub-transacton n CommtSet whch cx updates X ); change the value of X to that n ResultSet( MT ); Unlock all Xlock ; E. Correctness In our system, every datum has only one verson. To assure the seralzablty of executon, consequently assure the consstency of database, the relevant theorems are gven n the followng. Theorem To ether a moble sub-transacton MT ( n, n ), f ts ReadSet s sub-set of ts ReadableSet, then MT pass valdaton and the MTP can send ready MT to the MTC. Proof The theorem can be proved n the lght of three conflctons. cx The frst case (R-W conflcton). Because the values of data n the ReadSet of MT are the same as that of the correspondng data, so we can get the concluson that the data n ts ReadSet are not modfed durng the executng process of MT. Therefore there s no R-W conflcton. The sub-transacton MT passes valdaton. The second case (W-R conflcton). The case of W-R conflcton s that the part of the ReadSet of the moble transacton whch begns before MT and commts after t on MTP has ntersecton wth the WrteSet of sub-transacton MT. But because the data must be locked before are executed or valdated, so t s mpossble to appear the W-R conflcton. The thrd case (W-W conflcton). If a transacton begn to execute before the moble transacton and commt after t commt and ther WrteRets have ntersecton, then the case s the same as the second case and t s mpossble to occure. If a transacton begn after the moble transacton begn and commt before t commt, whle ther WrteSets have ntersecton, then ths case does not effect the correctness of transacton executon and cause the dsagreement of database. Accordng the number theorem, when a sub-transacton s beng valdated, f ts ReadSet s the subset of ts ReadableSet, then t passes the valdaton and the MTP can send ready MT to the MTC. Theorem 2 The ReadableSet of MT s a subset of the set composed of the ReadSets and WrteSets of all the sub-transactons to be valdated on NO. MTP and composed of all the unmodfed data on the FH snce the last synchronzaton between the FH and the MH. Theorem 3 To ether sub-transacton MT on the MTP, f ReadSet( MT ) ReadableSet( MT ), then ReadableSet( MT +, )=ReadableSet( MT ) U WrteSet( MT ), else ReadableSet( MT +, )=ReadableSet( MT )-WrteSet( MT ). Every datum has a verson number formatted as PVN[ SVN ].PVN s prmary verson number and SVN s secondary verson number whch s optmal to the data on clents. When a new datum s created on a FH, the prmary verson number s 0, SVN s <null>, and on a MH, the PVN s 508
set as, the SVN s transacton ID. When a datum s modfed on a FH, whose PVN ncreases by. Wth the executon of transactons on the moble clent, the secondary verson numbers (SVN) of data are modfed and the prmary verson (PVN) numbers are not. Therefore, comparng the PVNs of the data n the ReadSet or WrteSet of all the sub-transacton to be valdated can count the ReadableSet of the st sub-transacton MT. Wth the valdaton gong on, the ReadableSet of next sub-transacton can be counted usng NO.3 theorem. III. PERFORMANCE ASSESSMENT Ths model takes full use of clent buffer. If data n the WrteSet or buffer of clent can meet the need of transacton, then s computed locally by the LTM. After transactons have passed the valdaton, the ResultSets are combned nto database. Therefore, comparng wth O2PC_MT model, the model has hgher response speed and can meet the need of users wth the hgher performance. To assess the performance of ths model n other aspects, n smulaton experment, abort rate and throughout was selected as parameters to compare the performance of the model wth O2PL or those lke t. To smplfy, only one server s set n the server end to assess the performance of the gven model. The whole process of transacton executon s manly composed of three functons, whch are read_phase() valdaton() and globalcommt(). The functon read_phase() s called n read phase and runs on a moble host. The functon valdaton() s called n checkng the global valdaton of a transacton. Whle the functon globalcommt() runs on a server. The needed parameters of the whole experment are showed n table. The experment results are showed n fgure 2. The fgures named a and b show that performance of ths model s better than that of O2PL. Wth the ncreasng of the delay between operates, the throughput of O2PL falls remarkably. Whle the ncreasng of arrval rate, the transacton abort rate of ths model ncrease slowly, but the abort rate of O2PL ncreasng remarkably. Table Key parameters n the smulaton experment Parameters Values Meanng DBSze 000 The number of tuples n experment database TupleSze 256 The number of bytes of a tuple TransSze 6 The average number of μ 2%-20% operates of a transacton The arrval rate of moble transactons Delayf ms The delay between operates of fxed transactons Delaym 5-000ms The delay between operates of moble transactons (a) IV. SUMMARY In ths paper, a moble transacton processng model s provded drectng towards moble computng envronment, whch consders the moblty of clents and supports effectvely the dsconnecton and cross-regon move. The smulaton experment shows that the model can apply effectvely to moble computng envronment. (b) Fg. 2 Abort rates and throughputs of ths model and O2PL model 509
REFERENCES [] Margaret H. Dunham and Abdelsalam Helal, "A moble transacton model that captures both the data and movement behavor." Moble Networks and Applcaton (MONET), vol. 2, pp. 49-62, February 997. [2] Jn Jng, O. Bukhres and A. Elmagarmd," Dstrbuted lock management for moble transactons, "Proceedngs of the 5th Internatonal Conference on Dstrbuted Computng System (ICDC 95), Vancouver, pp. 8, 995. [3] Zhmng Dng, Xaofeng Meng and Shan Wang, "Optmstc transacton processng n moble database systems," Journal of Computer Research and Development, vol. 39, pp. -9, October 2002. [4] Zhmng Dng, Xaofeng Meng and Shan Wang," A novel conflct detecton and resoluton strategy based on TLRSP n replcated moble database systems," Proceedngs of the 7th Internatonal Conference on Database Systems for Advanced Applcatons(DASFAA 200), IEEE Press, Hong Kong, 200: 234-240. 50