Recent

Author Topic: Is Lazarus supports WireCompression in Firebird 3?  (Read 2816 times)

incendio

  • Sr. Member
  • ****
  • Posts: 269
Is Lazarus supports WireCompression in Firebird 3?
« on: December 12, 2018, 04:30:58 am »
Hi guys,

I am using Lazarus 1.8.4 in Windows and Linux with Firebird 3.0.3.

Firebird 3 supports WireCompression and I have set it enabled in server side via firebird.conf.

To connect to Firebird, I am using TSQLConnector/TIBConnection.

Is Lazarus supports WireCompression? If so, how to set it? I didn't see any property to set it in TSQLConnector /TIBConnection.

Thanks in advance.

Regards,
Sugi.

dsiders

  • Hero Member
  • *****
  • Posts: 1052
Re: Is Lazarus supports WireCompression in Firebird 3?
« Reply #1 on: December 12, 2018, 06:27:51 am »
I am using Lazarus 1.8.4 in Windows and Linux with Firebird 3.0.3.

Firebird 3 supports WireCompression and I have set it enabled in server side via firebird.conf.

To connect to Firebird, I am using TSQLConnector/TIBConnection.
Is Lazarus supports WireCompression? If so, how to set it? I didn't see any property to set it in TSQLConnector /TIBConnection.

Interesting question.  I saw a discussion on StackOverflow about enabling it (successfully) in FireDAC/Delphi Berlin. Not sure about sqldb et al on Lazarus.

If it supports it, you would have to add WireCompress=true in TIBConnection.Params. I think you need ZLIB1.DLL in the same directory as your application executable to handle the decompression duties on the client.

But I haven't had time to try it yet.
Preview Lazarus 3.99 documentation at: https://dsiders.gitlab.io/lazdocsnext

incendio

  • Sr. Member
  • ****
  • Posts: 269
Re: Is Lazarus supports WireCompression in Firebird 3?
« Reply #2 on: December 12, 2018, 08:35:11 am »
In windows, with c++ builder & third party tool & ZLIB1.dll, I am able to use compression feature. The performance is noticeable.

But with Lazarus, using TSQLConnector, add random values to its paramenter works without error, so I am not sure if Lazarus supports compression.

Beside, do you know what library to include in the same application folder in Linux?

dsiders

  • Hero Member
  • *****
  • Posts: 1052
Re: Is Lazarus supports WireCompression in Firebird 3?
« Reply #3 on: December 12, 2018, 07:54:18 pm »
Beside, do you know what library to include in the same application folder in Linux?

I'm not a Linux guru... but I think it should be called libz.so.
Preview Lazarus 3.99 documentation at: https://dsiders.gitlab.io/lazdocsnext

lucamar

  • Hero Member
  • *****
  • Posts: 4219
Re: Is Lazarus supports WireCompression in Firebird 3?
« Reply #4 on: December 12, 2018, 08:47:40 pm »
Beside, do you know what library to include in the same application folder in Linux?

Unless there is a special need, don't install in the application folder. Instead install the package, which is:
Code: Bash  [Select][+][-]
  1. lucamar@selene:~$ aptitude search zlib1
  2. i   zlib1g                          - Biblioteca de compresión, ejecutables    
  3. p   zlib1g-dbg                      - Biblioteca de compresión, símbolos de depuración
  4. i   zlib1g-dev                      - Biblioteca de compresión, símbolos de depuración
  5.  

But yes, the library file itself is called libz.so
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus/FPC 2.0.8/3.0.4 & 2.0.12/3.2.0 - 32/64 bits on:
(K|L|X)Ubuntu 12..18, Windows XP, 7, 10 and various DOSes.

incendio

  • Sr. Member
  • ****
  • Posts: 269
Re: Is Lazarus supports WireCompression in Firebird 3?
« Reply #5 on: December 13, 2018, 03:43:17 am »
I have manage to test Lazarus 1.8.4 in Windows OS, unfortunately, both TIBConnection & TSQLConnector are not supports WireCompression in Firebird 3.

valdir.marcos

  • Hero Member
  • *****
  • Posts: 1106
Re: Is Lazarus supports WireCompression in Firebird 3?
« Reply #6 on: December 13, 2018, 05:21:42 am »
I am using Lazarus 1.8.4 in Windows and Linux with Firebird 3.0.3.

Firebird 3 supports WireCompression and I have set it enabled in server side via firebird.conf.

To connect to Firebird, I am using TSQLConnector/TIBConnection.

Is Lazarus supports WireCompression? If so, how to set it? I didn't see any property to set it in TSQLConnector /TIBConnection.
1. Library zlib1 must be installed on your server.
2. Set parameter in firebird.conf or databases.conf, on server side:
   WireCompression=true
3. fbclient.dll and zlib1.dll must be of same bitness (32 or 64) of your binary, both must be on the same directory of your binary, on client side.
4. Create a firebird.conf with parameter WireCompression=true. Put this file on the same directory of your binary.
5. For future versions of Lazarus only, you can set the connection param:
   IBConnection1.Params.Add('wirecompression=true');


https://firebirdsql.org/file/documentation/release_notes/html/en/3_0/bk02ch06s06.html
----------------
WireCompression
Alex Peshkov

Parameter in firebird.conf or databases.conf, enabling or disabling compression of data over the wire at global or individual database level.

The default setting is disabled (= False). Settings and environment must be correct at both server and client for WireCompression to take effect:

    To enable it at the server side, in firebird.conf and/or databases.conf, change the setting to True
    To activate Wirecompression from the client side, pass the appropriate tag in the config item of the DPB or SPB call:

      isc_dbp_config/isc_sbp_config <string-length> "WireCompression=true"
               

    Both server and client versions must be Firebird 3 or greater (protocol >=13)
----------------

valdir.marcos

  • Hero Member
  • *****
  • Posts: 1106
Re: Is Lazarus supports WireCompression in Firebird 3?
« Reply #7 on: December 13, 2018, 05:23:19 am »
I have manage to test Lazarus 1.8.4 in Windows OS, unfortunately, both TIBConnection & TSQLConnector are not supports WireCompression in Firebird 3.
It should work. Please, review your environment and settings.

incendio

  • Sr. Member
  • ****
  • Posts: 269
Re: Is Lazarus supports WireCompression in Firebird 3?
« Reply #8 on: December 13, 2018, 05:51:47 am »
I have manage to test Lazarus 1.8.4 in Windows OS, unfortunately, both TIBConnection & TSQLConnector are not supports WireCompression in Firebird 3.
It should work. Please, review your environment and settings.

How?

I add TSQLQuery with SQL :
Code: Pascal  [Select][+][-]
  1. select RDB$GET_CONTEXT('SYSTEM', 'WIRE_COMPRESSED') as st from rdb$database

zlib1.dll also present in the same folder of compiled app.

If supported, it should return TRUE, but it return FALSE.

Same program and environment, created with C++Builder + third party tool return TRUE.
« Last Edit: December 13, 2018, 05:53:58 am by incendio »

 

TinyPortal © 2005-2018