UniDAC使用教程(七):断开模式

下载UniDAC最新版本

Universal Data Access Components (UniDAC)是一款通用数据库访问组件,提供了多个数据库的直接访问,如针对Windows的Delphi, C++Builder, Lazarus (以及 Free Pascal) , Mac OS X, iOS, Android, Linux和64和32位的FreeBSD等等。我们将长期的经验集于这个小组件,提供统一的数据库连接访问(如oracle、微软SQL等等)。这意味着您可以在您的项目之间轻松地切换不同的数据库,以及创建跨数据库应用程序接口。

在断开连接模式下,只有在需要时才能打开连接。执行所有服务器调用后,连接将自动关闭,直到需要下一次服务器调用。连接关闭时数据集保持打开状态。断开连接模式对于节省服务器资源和在不稳定或昂贵的网络中操作可能很有用。使用断开连接模式的缺点是,建立每个连接都需要一些时间进行授权。如果连接经常被关闭和打开,它会减慢应用程序的工作速度。我们建议使用池来解决这个问题。

要启用断开连接模式,请将TCustomDAConnection.Options.DisconnectedMode设置为True。

在断开连接模式下,打开连接以执行对服务器的请求(如果尚未打开),如果不再需要,则自动关闭连接。如果显式打开了连接(调用了Connect方法或将Connected属性显式设置为True),则在调用Disonnect方法或将Connected属性显式设置为False之前,它不会关闭。

建议在断开连接模式下使用以下设置:

1

2

3

TDataSet.CachedUpdates = True

TCustomDADataSet.FetchAll = True

TCustomDADataSet.Options.LocalMasterDetail = True

这些设置最小化了对服务器的请求数。

断开模式功能

如果在FetchAll选项设置为True的情况下执行查询,则当提取所有数据(如果其他人未使用)时,连接将关闭。如果FetchAll选项设置为False,则在获取所有数据块之前,连接不会关闭。

如果显式事务已启动,则在提交或回滚事务之前,连接不会关闭。

如果查询是显式准备的,则在取消准备查询或更改其SQL文本之前,连接不会关闭。

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
7.1.4 29-Sep-17 InterBase data provider Bug with the "Input parameter mismatch" error for procedure is fixed Bug with transactions when working with Firebird 2.5 is fixed 7.1.3 19-Sep-17 The performance of TVirtualQuery is significantly improved Application-defined functions in TVirtualQuery are supported Application-defined collations in TVirtualQuery are supported AutoInc fields in TVirtualTable are supported Bug with assertion failure when updating a record in TVirtualQuery is fixed Bug with compatibility with TkbmMemTable in TVirtualQuery is fixed Bug with complex WHERE clauses that have several string fields in TVirtualQuery is fixed Bug with selecting from a dataset with a single record in TVirtualQuery is fixed Bug with generating SQL for batch updates is fixed Bug with the Locate method for non-Windows platforms in Lazarus is fixed Bug with the FindFirst, FindLast, FindNext, FindPrior methods in Lazarus is fixed Bug with accessing a product help from the IDE menu is fixed Bug with recreating fields when calling Open after Prepare is fixed Bug with an incorrect error message when using the Connect dialog component on mobile platforms is fixed Bug with AV failure when using calculated fields in TClientDataset is fixed Bug with a key violation error when executing batch operations is fixed Bug with Assert when calling the Locate method in the SmartFetch mode is fixed Bug with using DAC components in DataModule for Linux is fixed Cloud data providers BigCommerce provider is added Dynamics CRM provider is added FreshBooks provider is added Magento provider is added MailChimp provider is added NetSuite provider is added QuickBooks provider is added Salesforce provider is added Salesforce Marketing Cloud provider is added SugarCRM provider is added Zoho CRM provider is added Oracle data provider Oracle 12c connection modes (SYSBACKUP, SYSDG, SYSKM) in the Direct mode are supported OS authentication in the Direct mode is supported NChar literal replacement is supported CLOB parameters behavior when UnicodeEnvironment=True is improved Bug with lost chars in a parameter value when ConvertEOL=True is fixed SQLServer data provider Bug with processing varchar fields when AutoTranslate is True in the Direct mode is fixed Bug with processing a field with alias for query with the JOIN statement is fixed Bug with date and time fractional seconds precision when DescribeParams = True is fixed MySQL data provider Azure Database for MySQL is supported JSON data type is supported InterBase data provider Support for Firebird on Android platform is added Support for Firebird 3 packages is added Aliases handling in the RETURNING clause is supported The WireCompression connection parameter for Firebird 3 is supported Bug with using BLOB data type in batch operations is fixed Bug with the OnBackupProgress event handler in TUniDADump is fixed Bug with using batch parameters of the Bytes type is fixed Bug with closing a connection that has an active transaction for Firebird 3 is fixed Bug with recreating a connection on Linux and mobile platforms is fixed PostgreSQL data provider SSPI authentication is supported Processing GUID data type for the TGuidField class is improved SQLite data provider Now the Direct mode is based on the SQLite engine version 3.20.0 Custom SQL aggregate functions are supported Bug with opening an existing database on iOS 64 is fixed Bug with detecting field types is fixed Bug with international symbols in non-Unicode Delphi versions is fixed Bug with low performance of the LoadFromDataSet method of the Loader component is fixed Bug with index backup using the Dump component when the TableNames property is set is fixed DBF data provider The CodePage specific options are added The ConnectMode specific options are added Bug with using CDX indexes is fixed DB2 data provider The DECFLOAT data type is supported

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值