资源描述:
《asp事务管理(asp transaction management)》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、asp事务管理(ASPtransactionmanagement)Firstofall,tobeatthetopofthepagetojointhesentence:<%@TRANSACTION=Required%>Ofcourse,ifthedatabasetransactionmanagement,donotneedtospecify<%@TRANSACTION=Required%>Atthesametime,activatetheerrorcapturestatementOnErrorResumeNext'transactionfa
2、ilurehandling,handlingmanualreturnsSubOnTransactionAbort'handlesmanualrollbacksegments,programfragments,forexample:OConn.rollbacktrans'rollbackOracledatabaseoperationsMsg="programrunningerror,operationfailed!"ImgSRC="wrong""EndSub'successfultransactioncompletiondisplaySub
3、OnTransactionCommit'programfragments,forexample:ImgSRC="right""Msg="successfuloperation"!"EndSubMethodofprocessingdatabasedatatransactioninasp:Usethesethreesentences:OConn.begintrans'starttransactionOConn.rollbacktrans'rollbacktransactionOConn.CommitTrans'committransactio
4、nAmongthem,oConnisthedataconnectionsource.ItcanbesqlServerorOracleDatabaseObjectContext.SetAbort'callstheSubOnTransactionAbortprocedure,notifiesallthecomponentsthatsupportthetransactiontorollback,andrunsthemanualrollbackcode'ObjectContext.SetComplete'callstheSubOnTransact
5、ionCommitprocessandendstheprocesstransactionInthedevelopmentofWebapplications,withoutexception,youneedtoaccessthedatabasetocompletedataquery,insert,update,deleteandotheroperations.SometimesittakesmultipledatatobeaffectedbytheapplicationlogicThelibraryoperationinstructionc
6、onsistsofaworkunit(transaction).Inadatabase,theso-calledtransactionreferstoasetoflogicaloperationunitsthattransformdatafromonestatetoanother.ToensurethenumberAccordingtotheconsistencyofthedatainthelibrary,thediscretegrouplogicunitshouldbeusedtomanipulatethedata:whenitisal
7、lcompleted,theconsistencyofthedatacanbemaintained;whenpartoftheoperationfailsintheunit,Theentiretransactioniscompletelyignored,andalloperationsfromthestartpointarereturnedtothestartingstate.Infact,bydefault,eachoperationofthedatabaseisimplicittransactionprocessing.Takinga
8、typicaluserregistrationprogramasanexample,thispaperintroducesthreekindsoftransactionprocessingus