SQLite 多线程开发 线程池问题

火车采集器商业版里面采用的是SQLite数据库存储数据,以前一直被多线程操作SQLite出现错误烦恼,以前的解决办法一直是在操作数据库时lock对象。
经过今天一天的研究,终于解决了这个难题。

问题解决提示:
1.研究System.Data.SQLite.dll (http://sqlite.phxsoftware.com/)附带的source test项目内的 TestCases.cs  多线程单元测试部分代码。

需要对每个连接克隆再使用 ((ICloneable)this.Connection).Clone() as DbConnection;

2.结合使用 ta8210兄的 实现高效的数据库连接池代码(http://blog.csdn.net/ta8210/archive/2007/04/24/1582162.aspx


在多线程多插入(非事务插入)及火车头程序中表现良好。算是基本解决了这个头疼的问题
引用通告地址: 点击获取引用地址
评论: 8 | 引用: 0 | 阅读: 2671
luiqt [ 2010-01-08 01:30 | 回复 | 编辑 删除 ]
太好了
discount oakley sunglass [ 2011-07-23 16:10 网址 | 回复 | 编辑 删除 ]
I am certainly thankful to you for providing us with this invaluable info. My spouse and I are truthfully grateful, precisely the computer data we needed
discount oakley sunglasses
huihaodeba [ 2011-10-13 13:36 网址 | 回复 | 编辑 删除 ]
The north face

However, most people need after canada goose parka a certain period of time under the expert guidance of training to master this knowledge, and here one of the most toxic non-toxic simple way to identify wild plants, north face for emergency use. Usually collected plants cut a small hole, put a pinch of salt, buy canada goose and then carefully observe whether the change in the original color, color of the plant can not eat normally.GT
Canada Goose Jackets [ 2011-11-30 12:01 网址 | 回复 | 编辑 删除 ]
Now choose Cheap Canada Goose Parka Jacket at Canada Goose Sale ne store is offering you a large number of cheap Canada Goose Jackets of you.So don't hesitate to place an order here,buy a Canada Goose Coats to shChilliwack Jacket,Canada Goose Expedition Parka Jacket and Canada Goose Parka Jacket.All items sale on our store are free shipping, welcom to buy one.
  • 1 
发表评论
昵 称: 密 码:
网 址: 邮 箱:
选 项:    
头 像:
内 容: