English 中文(简体)
仅支持1项交易?
原标题:sqlite only supports 1 transaction?

在使用ADO.NET时(可能是错误的,一意是知道它所说的话),一则通知,即,我只能用连接开始交易,指挥似乎有指挥力。 向我提供交易数据但有意启动交易的交易的交易吗? 实际上,在把这一点放在系统上。 数据。

// 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; }

仅仅支持一个交易期? i 试图打开另一条联系,但我的交易却对被锁定的亚洲开发银行提出了例外。 因此,我不可能有更多的联系同时存在?

最佳回答

一项交易,即是,但可以有不止一种联系(每项交易都有自己的积极交易)。

<Update: 有趣。 我不知道共同的切身模式。 如果您的关联使用这一模式,则只有一种交易可以用于使用相同共同点的所有联系。 见。 共享模式

问题回答

我不相信多条连接,很可能与文件夹关在一起,因为“King”是一个基于档案的行文,而不是一个基于服务器的行文(一个基于服务器的行,服务器把所有档案都锁起来,同时处理连接)。

当时你只能有一次交易。 这一点应当直观,因为在你开始交易之后发生的一切都是在交易中,直到有<条码>反馈或<条码>。 然后,你可以开始一个新项目。 独一无二地要求所有指挥都进行交易,因此,如果你没有手工操作新的交易,就会给你造成损失。

如果你重新对冻结的交易表示担忧,你可以将其打上<条码>savepoint Documentation

在1项交易中,在交易完成之前,你只能读/读到1项。 因此,如果你做生意交易,就象这样多份微不足道的发言,就必须通过联系人:

public class TimeTableService
    {
        ITimeTableDataProvider _provider = new TimeTableDataProvider();

        public void CreateLessonPlanner(WizardData wizardData)
        {
            using (var con = _provider.GetConnection())
            using (var trans = new TransactionScope())
            {
                con.Open();

                var weekListA = new List<Week>();
                var weekListB = new List<Week>();

                LessonPlannerCreator.CreateLessonPlanner(weekListA, weekListB, wizardData);

                _provider.DeleteLessonPlanner(wizardData.StartDate, con);

                _provider.CreateLessonPlanner(weekListA, con);
                _provider.CreateLessonPlanner(weekListB, con);

                _provider.DeleteTimeTable(TimeTable.WeekType.A, con);
                _provider.StoreTimeTable(wizardData.LessonsWeekA.ToList<TimeTable>(), TimeTable.WeekType.A, con);

                _provider.DeleteTimeTable(TimeTable.WeekType.B, con);
                _provider.StoreTimeTable(wizardData.LessonsWeekB.ToList<TimeTable>(), TimeTable.WeekType.B, con);

                trans.Complete();
            }
        }
    }

链接和瞬间资源通过使用报表自动公布/关闭。

在每一种数据提供方法中,你会这样做。

using(var cmd = new SQLiteCommand("MyStatement",con)
{
   // Create params + ExecuteNonQuery
}

交易 范围类别在NET3.5中是新类别,如果出现例外,则自动进行。 方便处理





相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

NSArray s, Primitive types and Boxing Oh My!

I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

How to Use Ghostscript DLL to convert PDF to PDF/A

How to user GhostScript DLL to convert PDF to PDF/A. I know I kind of have to call the exported function of gsdll32.dll whose name is gsapi_init_with_args, but how do i pass the right arguments? BTW, ...

Linqy no matchy

Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...

热门标签