線上訂房服務-台灣趴趴狗聯合訂房中心
發文 回覆 瀏覽次數:1161
推到 Plurk!
推到 Facebook!

"Cannot create new transaction..." 會在什麼情況發生呢?

答題得分者是:pgdennis
kitsnews
一般會員


發表:9
回覆:17
積分:10
註冊:2003-06-16

發送簡訊給我
#1 引用回覆 回覆 發表時間:2003-08-01 05:59:52 IP:202.14.xxx.xxx 未訂閱
"Cannot create new transaction because capacity was exceeded" 小弟是 delphi 新手, 在一個 application 中, 只放了一個 TSQLConnection 以及數個 TSimpleDataSet 來反映數個 MS SQL Server 內的 table. 那數個 TSimpleDataSet 的 Connection 屬性都指向那唯一拖放出來的 TSQLConnection. 現在程式執行時, 所有 move 的動作都沒有問題, 但當我做了任何異動, 及運行 TSimpleDataSet.ApplyUpdates(0); 的時候, 就得到以上的錯誤. 我又試試為每一個 TSimpleDataSet 拖放一個 TSQLConnection. 程式執行時, 我做任何異動, 及運行 TSimpleDataSet.ApplyUpdate(0), 又沒有問題, 想請教各位前輩, 其實問題是出於那, 以及正確的處理方式應該是怎樣的呢? * 小弟參考了上面的文章, 但還是不明白, 請原諒小弟 http://delphi.ktop.com.tw/topic.php?topic_id=28804 小弟乃是 delphi 新手, 請各位前輩多多指教. 我十分欣賞 delphi ktop 的那種互助的精神.
hagar
版主


發表:143
回覆:4056
積分:4445
註冊:2002-04-14

發送簡訊給我
#2 引用回覆 回覆 發表時間:2003-08-01 08:10:10 IP:202.39.xxx.xxx 未訂閱
http://groups.google.com.tw/groups?hl=zh-TW&lr=&ie=UTF-8&oe=UTF-8&th=177a5f23580aa937&rnum=1 該篇提到可能是 MS SQL Server 不支援 overlapping/nested transactions 的關係. --- --<-<-<@
pgdennis
資深會員


發表:41
回覆:526
積分:443
註冊:2002-05-23

發送簡訊給我
#3 引用回覆 回覆 發表時間:2003-08-01 08:54:53 IP:218.163.xxx.xxx 未訂閱
1. The most likely cause of this error is when one or more ADO Recordset objects are already open and is using the same ADO Connection object. The type of recordset may also affect the ability to use BeginTrans. For instance ForwardOnly recordsets may block a BeginTrans if the SQL provider doesn't detect this and create a new connection in the background. So please make sure that all recordsets and commands must be closed for a connection object before using BeginTrans. 2. You can also try applying the latest MDAC to solve the problem. Please download it from www.microsoft.com/data 大部分問題好像都指向上述的情形,hager兄回答的那一篇中的連結有滿多討論的,你可以看看,歸納一下.... 永遠追不上技術更新的速度
------
星期一,二...無窮迴圈@@
kitsnews
一般會員


發表:9
回覆:17
積分:10
註冊:2003-06-16

發送簡訊給我
#4 引用回覆 回覆 發表時間:2003-08-01 09:08:05 IP:202.64.xxx.xxx 未訂閱
引言: 1. The most likely cause of this error is when one or more ADO Recordset objects are already open and is using the same ADO Connection object. The type of recordset may also affect the ability to use BeginTrans. For instance ForwardOnly recordsets may block a BeginTrans if the SQL provider doesn't detect this and create a new connection in the background. So please make sure that all recordsets and commands must be closed for a connection object before using BeginTrans. 2. You can also try applying the latest MDAC to solve the problem. Please download it from www.microsoft.com/data 大部分問題好像都指向上述的情形,hager兄回答的那一篇中的連結有滿多討論的,你可以看看,歸納一下.... 永遠追不上技術更新的速度 < face="Verdana, Arial, Helvetica"> 先謝謝兩位前輩的回答, 我嘗試了用 TSimpleDataSet 自己的 Connection, 而且還把 KeepConnection 屬性設為 False, 但這句錯誤還是出現呢. 我估, 是否會和我那個 table 有4000多條 record 有關呢? 我會嘗試新的 MDAC 了.. 這個問題可令我獲益良多呢.... 小弟乃是 delphi 新手, 請各位前輩多多指教. 我十分欣賞 delphi ktop 的那種互助的精神.
kitsnews
一般會員


發表:9
回覆:17
積分:10
註冊:2003-06-16

發送簡訊給我
#5 引用回覆 回覆 發表時間:2003-08-01 09:34:12 IP:202.14.xxx.xxx 未訂閱
真的奇怪, 我把所有 TSimpleDataSet 的 Connection 都指回 InternalConnection. , 再 delete 所有 TSQLConnection. 這樣子便沒有問題了... 小弟乃是 delphi 新手, 請各位前輩多多指教. 我十分欣賞 delphi ktop 的那種互助的精神.
系統時間:2024-06-28 13:45:42
聯絡我們 | Delphi K.Top討論版
本站聲明
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。
2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。
3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇!