全國最多中醫師線上諮詢網站-台灣中醫網
發文 回覆 瀏覽次數:1540
推到 Plurk!
推到 Facebook!

Transaction

答題得分者是:Justmade
懷舊的人
高階會員


發表:28
回覆:152
積分:141
註冊:2003-01-08

發送簡訊給我
#1 引用回覆 回覆 發表時間:2003-06-26 13:20:37 IP:152.104.xxx.xxx 未訂閱
可不可能同時使用兩個 Transaction ? (同一個 Connection )
Justmade
版主


發表:94
回覆:1934
積分:2030
註冊:2003-03-12

發送簡訊給我
#2 引用回覆 回覆 發表時間:2003-06-26 13:52:15 IP:218.16.xxx.xxx 未訂閱
dbExpress 及 ADO 均可以但也要看後台 Database 支不支援    以下節錄 Help File :    StartTransaction method (TSQLConnection) Initiates a new transaction in the associated database. Delphi syntax: procedure StartTransaction(TransDesc: TTransactionDesc); Description Call StartTransaction to start a new transaction against a database server that supports transactions. (MySQL servers do not support transactions.) You can check the TransactionsSupported property to determine whether the server supports transactions. If the server does not support transactions, StartTransaction does nothing. TransDesc describes the transaction you are starting. It lets you specify A user-defined transaction identifier. If the server supports nested or overlapped transactions, you can initiate multiple transactions by calling StartTransaction and providing each transaction with its own unique identifier. The transaction isolation level. This indicates the degree to which this transaction can see?changes made by other transactions. If the transaction is successfully started, StartTransaction sets the InTransaction property to true. Updates, insertions, and deletions that take place after a call to StartTransaction are enlisted in that transaction until another overlapping transaction is started or until the application calls Commit to save the changes or Rollback to cancel them. Tip: If the server does not support multiple transactions, check the status of the InTransaction property to be sure that another transaction is not already in progress. Tip: When working with overlapped transactions, you can indicate the transaction to which a dataset belongs by setting its TransactionLevel property to the transaction identifier you assign in this method. ------------------------------------ BeginTrans method (TADOConnection) initiates a new transaction in the associated database. Delphi syntax: function BeginTrans: Integer; Description Call BeginTrans to start a new transaction in the data store the ADO connection component is connected to. BeginTrans returns a value of type integer, indicating the nesting level of the new transaction. A successful execution of BeginTrans triggers an OnBeginTransComplete event and sets the InTransaction property to true. Note: The ADO connection object must have an active connection before BeginTrans can be used.
channel
尊榮會員


發表:67
回覆:707
積分:854
註冊:2002-05-02

發送簡訊給我
#3 引用回覆 回覆 發表時間:2003-06-26 13:54:32 IP:211.21.xxx.xxx 未訂閱
引言: 可不可能同時使用兩個 Transaction ? (同一個 Connection )
不知這是不是您要的... Database1.ApplyUpdates([Query1, Query2]) 利用TDatabase元件進行ApplyUpdates 若成功則一起Commit 若一個失敗則一起Rollback ~小弟淺見,參考看看~
------
~小弟淺見,參考看看~
懷舊的人
高階會員


發表:28
回覆:152
積分:141
註冊:2003-01-08

發送簡訊給我
#4 引用回覆 回覆 發表時間:2003-06-26 14:14:11 IP:152.104.xxx.xxx 未訂閱
謝謝 channel 不過這不是我要的,到是如 Justmade 所說的 ,只是我還沒試成功
系統時間:2024-05-11 11:29:32
聯絡我們 | Delphi K.Top討論版
本站聲明
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。
2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。
3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇!