如何使用FireDAC在Firebird 3.0上启用WireCompression [英] How to enable WireCompression on Firebird 3.0 using FireDAC

查看:199
本文介绍了如何使用FireDAC在Firebird 3.0上启用WireCompression的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望使用WireCompression连接到Firebird Server 3.0。这是自3.0版以来的一项新功能,我很难做到这一点,我唯一能找到的书面说明是将firebird.conf中的WireCompression设置为TRUE并使用connect参数 wirecompression = true。

I am looking to connect to Firebird Server 3.0 using WireCompression. This being new feature since version 3.0 I'm having a hard time to get it to do so and the only documented instructions I can find is setting WireCompression to TRUE in firebird.conf and use the connect parameter "wirecompression=true".

这就是我到目前为止所要做的:

This is what I've got this far:

firebird.conf:

firebird.conf:

# Firebird configuration file for Firebird 3.0 64-bit SuperServer
# Optimized by IBSurgeon (www.ib-aid.com) for HQbird distribution.
#

ServerMode = Super

#DatabaseAccess = Full
#RemoteAccess = true
#ExternalFileAccess = None
#UdfAccess = Restrict UDF
#TempDirectories =
#AuditTraceConfigFile =
#MaxUserTraceLogSize = 10

DefaultDbCachePages = 50000

#DatabaseGrowthIncrement = 128M
#FileSystemCacheThreshold = 64K
#FileSystemCacheSize = 0
#RemoteFileOpenAbility = 0

TempBlockSize = 2M
TempCacheLimit = 364M

AuthServer = Srp
AuthClient = Srp, Win_Sspi, Legacy_Auth
UserManager = Srp
#WireCryptPlugin = Arc4

#hqbird traceapi plugin should be in plugins folder!
TracePlugin = fbtrace2db

#CryptPlugin = Arc4
#KeyHolderPlugin =
#Providers = Remote,Engine12,Loopback
#DeadlockTimeout = 10
#MaxUnflushedWrites = 100
#MaxUnflushedWriteTime = 5
#BugcheckAbort = 0
#RelaxedAliasChecking = 0
#ConnectionTimeout = 180
#(for client) / Required (for server)

WireCompression = true
WireCrypt = enabled
#DummyPacketInterval = 0
#RemoteServiceName = gds_db

RemoteServicePort = 3050

#RemoteAuxPort = 0
#TcpRemoteBufferSize = 8192
#TcpNoNagle = 1
#RemoteBindAddress =

LockMemSize = 9M

#LockAcquireSpins = 0

LockHashSlots = 30011

#EventMemSize = 64K
#CpuAffinityMask = 0
#GCPolicy = combined
#SecurityDatabase = $(dir_secDb)/security3.fdb

GuardianOption = 1

#ProcessPriorityLevel = 0
#IpcName = FIREBIRD
#RemotePipeName = interbas

连接代码:

  //Info: FDB = TFDConnection
  with FDB.Params do
  begin
      Clear;
      Add('DriverID=FB');
      Add('Database=' + vDatabase);
      Add('User_Name=' + AUsername);
      Add('PassWord=' + APassword);
      Add('WireCompression=true');
  end;

  FDB.FetchOptions.Unidirectional:= true;
  FDB.FetchOptions.RowsetSize:= 1000;
  FDB.ResourceOptions.SilentMode:= true;

  FDB.Connected := true;

  vConnectionInfo:= TStringList.Create;
  FDB.GetInfoReport(vConnectionInfo);

  ShowMessage(vConnectionInfo.Text);

  Clipboard.AsText:= vConnectionInfo.Text;

  FreeAndNil(vConnectionInfo);

  Result := FDB.Connected;

已建立连接,但vConnectionInfo表示:

The connection is established, but vConnectionInfo says:

================================
Connection definition parameters
================================
DriverID=FB
Database=server:D:\Databases\FB3.0\test\test.FDB
User_Name=sysdba
PassWord=*****
WireCompression=true
================================
FireDAC info
================================
Tool = RAD Studio 10.1 Berlin
FireDAC = 15.0.1 (Build 86746)
Platform = Windows 32 bit
Defines = FireDAC_NOLOCALE_META;FireDAC_MONITOR
================================
Client info
================================
Loading driver FB ...
Brand = Firebird
Client version = 300009900
Client DLL name = D:\D10\Projects\TestFB30 Client\Win32\Debug\fbclient.dll
================================
Session info
================================
Current catalog = 
Current schema = 
Server version = WI-V3.0.0.32483 Firebird 3.0
WI-V3.0.0.32483 Firebird 3.0/tcp (server)/P13:C
WI-V3.0.0.32483 Firebird 3.0/tcp (laptop)/P13:C

最后两行说我有协议v13(P13),并且数据已加密(:C),但应为P13:CZ表示zlib压缩。

Those last two lines say I have protocol v13 (P13) and the data is enCrypted (:C) but it should be P13:CZ indicating a zlib compression.

我在调试中有zlib1.dll客户端文件夹中,并且zlib1.dll位于Firebird服务器文件夹中的服务器上。

i have the zlib1.dll in the debug folder on the client side, and the zlib1.dll is present on the server in the Firebird server folder.

可以连接到数据库,我收到错误消息。

I can connect to the database, I get no error messages.

我已经耗尽了要应用压缩的想法,但是我对你们有信心

I am running out of ideas to get the compression to be applied, but I have faith in you guys to help me out!

推荐答案

要使用FireDAC启用zlib压缩,您需要做的是:

In order to enable zlib compression using FireDAC all you need to do is:


  1. 通过设置wirecompression = true,使用firebird.conf启用wirecompression服务器端

  2. 具有正确的/ s fbclient.dll客户端的ame版本

  3. 将正确的zlib1.dll(在我的情况下为x86)放在包含客户端exe的文件夹中

  4. 创建一个firebird.conf并添加wirecompression = true行并将其保存到您的exe文件所在的文件夹中。

  5. 将wirecompression = true添加到连接参数中

  1. Enable wirecompression server side using firebird.conf by setting wirecompression=true
  2. Have the proper/same version of fbclient.dll client side
  3. Place the correct zlib1.dll (x86 in my case) in the folder that contains the client exe
  4. Create a firebird.conf and add the line wirecompression=true and save it to the same folder your exe is.
  5. Add wirecompression=true to the connection params

现已启用无线压缩。

这篇关于如何使用FireDAC在Firebird 3.0上启用WireCompression的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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