2012-03-23 33 views
1

我遇到了一個sqlite數據庫程序的問題。我想30級的數據庫連接在一起,並運行到10誤差極限: 「SQLite的錯誤 太多附加的數據庫 - 最大10」附加限制> 10

根據http://www.sqlite.org/c3ref/limit.html我們應該可以設置允許連接數據庫的最大數量到10多。我正在使用C#和system.data.sqlite.dll作爲接口。有誰知道我可以如何設置限制> 10?

+2

我可能會誤解,但該鏈接似乎包含有關如何更改它的說明。 – cadrell0 2012-03-23 19:35:23

回答

4

implementation limits頁(重點煤礦):

The maximum number of attached databases can be lowered at run-time using the sqlite3_limit(db,SQLITE_LIMIT_ATTACHED,size) interface.

Run-time limits頁:

For each limit category SQLITE_LIMIT_NAME there is a hard upper bound set at compile-time by a C preprocessor macro called SQLITE_MAX_NAME. (The " _ LIMIT _ " in the name is changed to " _ MAX _ ".) Attempts to increase a limit above its hard upper bound are silently truncated to the hard upper bound.

基於這樣的事實,你只能lowet極限,我覺得SQLITE_LIMIT_ATTACHED是編譯的常量設置爲10.如果要將其設置得更大,則必須在源代碼中對其進行更改並重新編譯SQLITE。

還有更多:

The code generator in SQLite uses bitmaps to keep track of attached databases. That means that the number of attached databases cannot be increased above 62.

有你有它。即使你使其大於10,由於數據庫的體系結構,62也是一個物理硬限制。

+0

我找到的解決方案是從sqlite.org修改system.data.sqlite.dll項目以擴展最大連接大小。它需要一個新的DLL來運輸和維護,但使用上面的帖子中的信息是可能的。謝謝 – jswanstr 2012-03-23 21:08:29