SQLCE连接:保持打开状态还是关闭状态? [英] SQLCE Connections: Keep them open or let them close?

查看:89
本文介绍了SQLCE连接:保持打开状态还是关闭状态?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

考虑到移动设备的性能,您认为使用SQLCE Con​​nection的最佳方法是什么.在应用程序运行期间保持打开状态,或者在需要调用数据库时关闭它.

Keeping performance on a mobile device in mind, what do you think is the best approach with an SQLCE Connection. Keep it open for the duration of the application or let it close whenever a call to the database is needed.

显然,这在某种程度上取决于您的应用程序的性质,但是我很好奇听到该小组实施了什么以及为什么这样做.

Obviously this depends a little on the nature of your application however I'm curious to hear what the group has implemented and why.

推荐答案

您一定应该看一下史蒂夫·拉斯克(Steve Lasker)的关于SQL Server Compact Edition的PDC08会议.关于性能,最佳实践和他自己的基准(约37:00).

You should definitely watch Steve Lasker's PDC08 session about SQL Server Compact Edition. There's a part about performance, best practices and his own benchmarks (~37:00).

简而言之,请保持打开状态,尝试重用命令,并将SqlCeResultSet用于批量操作.

In short, keep it open, try to reuse commands, and use SqlCeResultSet for bulk operations.

这篇关于SQLCE连接:保持打开状态还是关闭状态?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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