Using Compression with Firebird 3

Discussion of open issues, suggestions and bugs regarding IBDAC (InterBase Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
j_smart
Posts: 3
Joined: Mon 23 May 2016 03:51

Using Compression with Firebird 3

Post by j_smart » Mon 23 May 2016 03:56

How can I (from the client side) using IBDAC, apply the parameter to use compression?

According to the docs, I need to set WireCompression=true via a Database Parameter Block but not sure how to apply that using these components. I could see no property. I thought it may be under the Options memo on the TIBCConnection property but unsure what value to use for "Name". Using WireCompression=true here reports "Unknown DPB constant (wirecompression)".

I am running components version 5.7.23.

Thanks

ViktorV
Devart Team
Posts: 2618
Joined: Wed 30 Jul 2014 07:16

Re: Using Compression with Firebird 3

Post by ViktorV » Wed 25 May 2016 10:08

Currently, IBDAC doesn't support compression for Firebird 3. We will consider the possibility to add this functionality. If you want us to implement the feature, please post it at our user voice forum: https://devart.uservoice.com/forums/104 ... e-firebird. If the suggestion gets a lot of votes, we will consider the possibility to implement it.

ViktorV
Devart Team
Posts: 2618
Joined: Wed 30 Jul 2014 07:16

Re: Using Compression with Firebird 3

Post by ViktorV » Mon 25 Sep 2017 09:04

The new IBDAC 6.1.3 including support for WireCompression connection parameter for Firebird 3 is already available for download now.

Jank
Posts: 30
Joined: Tue 11 May 2010 11:57

Re: Using Compression with Firebird 3

Post by Jank » Tue 19 Dec 2017 08:42

Hi,

I have 6.1.4 an the source of IBCClasses.pas looks like that

Code: Select all

    {$IFDEF LITE}
      if FWireCompression and (FParams.IndexOfName('WireCompression') < 0) then
        FParams.Add('WireCompression=True');
    {$ENDIF LITE}
What is this "LITE"-Compilerdefine. It is not active for me.

Regards, Jan

ViktorV
Devart Team
Posts: 2618
Joined: Wed 30 Jul 2014 07:16

Re: Using Compression with Firebird 3

Post by ViktorV » Tue 19 Dec 2017 10:32

LITE is define used for dbExpress driver for InterBase and Firebird. In IBDAC, this code is not used.

Jank
Posts: 30
Joined: Tue 11 May 2010 11:57

Re: Using Compression with Firebird 3

Post by Jank » Tue 19 Dec 2017 10:50

Okay, thank you for the Information.

How do I activate the wired compression for Firebird 3 with IBDAC?

ViktorV
Devart Team
Posts: 2618
Joined: Wed 30 Jul 2014 07:16

Re: Using Compression with Firebird 3

Post by ViktorV » Tue 19 Dec 2017 11:03

To enable WireCompression on the client side, you should add the string "WireCompression=true" to the IBCConnection.Params. For example:

Code: Select all

IBCConnection.Params.Add('WireCompression=true');

Jank
Posts: 30
Joined: Tue 11 May 2010 11:57

Re: Using Compression with Firebird 3

Post by Jank » Tue 19 Dec 2017 12:11

Thank You!

Jank
Posts: 30
Joined: Tue 11 May 2010 11:57

Re: Using Compression with Firebird 3

Post by Jank » Tue 13 Nov 2018 08:19

Hello again,

I', using now Firebird 3.0.4, IBDAC 6.1.4 for RAD Studio 10 and added this param:
WireCompression=true

With Firebird 3.0.4 I can check the context variable WIRE_COMPRESSION. In this constellation it is false:

Code: Select all

select RDB$GET_CONTEXT('SYSTEM', 'WIRE_COMPRESSED')  from rdb$database
What do I wrong?

Code: Select all

procedure TForm4.Button1Click(Sender: TObject);
var
  IBCConnection1: TIBCConnection;
  IBCQuery1: TIBCQuery;
begin
  IBCConnection1 := TIBCConnection.Create(nil);
  try
    IBCConnection1.Database := 'e:\db\mydb.fdb';
    IBCConnection1.Params.Add('WireCompression=true');
    IBCConnection1.ClientLibrary := '.\fbclient.dll';
    IBCConnection1.Server := 'localhost';
    IBCConnection1.Port := '3053';
    IBCConnection1.LoginPrompt := False;
    IBCConnection1.Username := 'XXXXXXXX';
    IBCConnection1.Password := 'XXXXXXXX';

    IBCQuery1 := TIBCQuery.Create(nil);
    try
      IBCQuery1.Connection := IBCConnection1;
      IBCQuery1.SQL.Text := 'select RDB$GET_CONTEXT(''SYSTEM'', ''WIRE_COMPRESSED'')  from rdb$database';

      IBCConnection1.Open;
      IBCQuery1.Open;

      caption := IBCQuery1.Fields[0].AsString;

      IBCQuery1.Close;
      IBCConnection1.Close;

    finally
      FreeAndNil(IBCQuery1);
    end;
  finally
    FreeAndNil(IBCConnection1);
  end;
end;
Regards, Jan

ViktorV
Devart Team
Posts: 2618
Joined: Wed 30 Jul 2014 07:16

Re: Using Compression with Firebird 3

Post by ViktorV » Tue 13 Nov 2018 11:01

In order for compression to work correctly, you should use the zlib1.dll library, the bitness of which should correspond to the bitness of your application. Please place the required zlib1.dll library in the directory with your executable file and make sure that your application starts useing it when calling the TIBCConnection.Connect method.
Note, in order to determine whether your application uses zlib1.dll you can use a third-party utility, e.g. Process Explorer.

Jank
Posts: 30
Joined: Tue 11 May 2010 11:57

Re: Using Compression with Firebird 3

Post by Jank » Tue 13 Nov 2018 13:14

Thank you, it works!

ViktorV
Devart Team
Posts: 2618
Joined: Wed 30 Jul 2014 07:16

Re: Using Compression with Firebird 3

Post by ViktorV » Tue 13 Nov 2018 13:16

It is good to see that the problem has been solved.
Feel free to contact us if you have any further questions about our products.

Post Reply