sqlite的只支持1交易? [英] sqlite only supports 1 transaction?

查看:184
本文介绍了sqlite的只支持1交易?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在使用ADO.NET(也许我错了,我不知道其所谓的)我注意到,我只能开始事务与连接和命令似乎有command.Transaction这让我的交易数据,但犯规开始交易本身?其实,同时寻找我看到这个System.Data.SQLite

While using ADO.NET (maybe i am wrong, i dont know what its called) i notice that i can only begin a transaction with a connection and a command seems to have command.Transaction which gets me the transaction data but doesnt start a transaction itself? Actually while looking i see this in System.Data.SQLite

// Summary:
    //     The transaction associated with this command. SQLite only supports one transaction
    //     per connection, so this property forwards to the command's underlying connection.
    [Browsable(false)]
    [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
    public SQLiteTransaction Transaction { get; set; }

所以SQLite的只支持一个交易周期?我试图打开另一个连接,但当时我的交易投掷关于DB异常被锁定。所以我不能有一个以上的并发连接,以及?

So SQLite only supports one transaction period? i tried opening another connection but then my transaction threw an exception about the DB being locked. So i cannot have more then one connection concurrent as well?

推荐答案

每一个关联交易,是的,但它可以有多个连接(每个都有自己的活动事务)。

One transaction per connection, yes, but it can have more than one connection (each with its own active transaction).

更新:的有趣。我不知道的共享缓存模式。如果你的连接使用该模式,只有一个事务适用于所有使用相同的共享高速缓存的连接。请参见 SQLite的共享缓存模式

Update: interesting. I didn't know about shared-cache mode. If your connection is using that mode, only one transaction is available for all the connections using the same shared-cache. See SQLite shared-cache mode.

这篇关于sqlite的只支持1交易?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆