Groups
Groups
Sign in
Groups
Groups
Ruby on Rails Taiwan
Conversations
About
Send feedback
Help
向mssql數據庫插入數據時報錯:無法啟動多個事務
6 views
Skip to first unread message
bluege...@gmail.com
unread,
Jul 12, 2008, 5:56:07 AM
7/12/08
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Ruby on Rails Taiwan
我是在rails中通過ActiveRecord::Base.connection.execute( sql )向數據庫插入數據時報錯,說
無法啟動多個事務。我的代碼裡沒有使用任何事務,只是簡單的插入數據,不過我是通過一
個數據庫到另外一個數據庫的鏈接進行數據插入的,比如有數據庫服務器serverA,和
serverB,serverA和serverB做了鏈接,我是直接連接的serverA的數據庫dA,然後來向serverB
的數據庫dB的表tB插入數據,語句是這樣的:
inset into [serverB].dB.dbo.tB ......。不知道這個“無法啟動多個事務”是什麼原因造成的,請各位幫助,謝謝
JellyCatz果凍喵
unread,
Jul 13, 2008, 8:40:09 PM
7/13/08
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Ruby on Rails Taiwan
Rails基本上只支援單一DB....需要外掛套件或用特殊手法才有多DB支援...不知道是否在這環節出錯??
不過直接下SQL應該是和這前提沒關係的.....語法有在純SQL環境下測過嗎??基本上過了才在Rails上使用吧?
On 7月12日, 下午5時56分, "
bluegene....@gmail.com
" <
bluegene....@gmail.com
>
wrote:
bluege...@gmail.com
unread,
Jul 19, 2008, 7:00:09 AM
7/19/08
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Ruby on Rails Taiwan
問題的原因已經清楚了,就是通過兩個數據庫鏈接訪問的問題,謝謝
Reply all
Reply to author
Forward
0 new messages