如何禁用Android的SQLite的日志文件? [英] How to disable Android SQLite Journal file?

查看:330
本文介绍了如何禁用Android的SQLite的日志文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的交易,以多行插入表中。但是,我还是看到sqlite的表一起在SD卡上创建临时的sqlite-日志文件。

I am using transactions to insert multiple rows into table. But, I still see temporary sqlite-journal file being created on SD Card along with sqlite table.

我如何禁用日志文件的创建?

How do I disable creation of journal file?

感谢

推荐答案

您可以选择保留该杂志在内存中,以便没有-journal文件被创建:

You can elect to keep the journal in memory so that no -journal file is created:

pragma journal_mode=memory;

请注意,你需要把这个打开数据库,每次运行。

Note that you need to run this each time you open the database.

我建议您阅读以下获得正在发生的事情的一个更好的主意:

I recommend that you read the following to get a better idea of what is going on:

<一个href=\"http://www.sqlite.org/pragma.html#pragma_journal_mode\">http://www.sqlite.org/pragma.html#pragma_journal_mode

这篇关于如何禁用Android的SQLite的日志文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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