MonoTouch:SQLite-net线程安全性和SQLiteConfig.Serialized [英] MonoTouch: SQLite-net thread safety and SQLiteConfig.Serialized

查看:34
本文介绍了MonoTouch:SQLite-net线程安全性和SQLiteConfig.Serialized的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图通过调用以下代码来使 SQLite 默认为更多"线程安全的:

I am trying to make SQLite default to be "more" thread-safe by calling something like this code:

SqliteConnection.SetConfig (SQLiteConfig.Serialized);

我认为这与设置有关:

 DSQLITE_THREADSAFE=1

但是如何做也是一个谜.

But how to do that is a mystery too.

使用很棒的 SQLite-NET ORM 来实现MonoTouch,似乎没有办法设置SQLiteConfig.Serialized?

Using the Awesome SQLite-NET ORM for MonoTouch, there doesn't seem to be a way to set SQLiteConfig.Serialized?

想法?

推荐答案

我的(不是最近的)SQLite.cs 副本具有在 SQLite3 类型中定义的此方法:

My (not really recent) copy of SQLite.cs has this method defined in SQLite3 type:

public static extern Result Config (ConfigOption option);

ConfigOption 定义为:

public enum ConfigOption : int
{
    SingleThread = 1,
    MultiThread = 2,
    Serialized = 3
}

这篇关于MonoTouch:SQLite-net线程安全性和SQLiteConfig.Serialized的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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