Lazarus

Announcements => Third party => Topic started by: tonyw on December 06, 2018, 05:29:53 pm

Title: IBX 2.3.2 is now available for download
Post by: tonyw on December 06, 2018, 05:29:53 pm
MWA Software is pleased to announce that release 2.3.2 of IBX for Lazarus is now available for download from https://mwasoftware.co.uk/ibx. Older versions of IBX will fail to compile with Lazarus 2.0 and upgrade to this version is necessary for use with Lazarus 2.0. All users are recommended to upgrade to the new release. Please read the changelog before upgrading. The release also includes a new SQL Tokeniser and the ability to select the Firebird Library (DLL or shared object) as a property of TIBDatabase or TIBXServicesConnection. Several minor bug fixes are also included.

The release fixes two problems with use of Lazarus 2.0:


The new SQL Tokeniser has been primarily developed in order to avoid mis-identification of PSQL parameters within BEGIN..END blocks as IBX query parameters. This allows parameterised EXECUTE BLOCK statements to be supported. The new SQL Tokeniser is also used for TIBSQLParser and TIBXScript, in both cases removing duplicate code.

Both TIBDatabase and TIBXServicesConnection now include a new property "FirebirdLibraryPathName". This can be used to explicitly specify the full path to the firebird client library (DLL or shared object). For example, when the library is in a non-standard location or to avoid ambiguity when more than one library is installed. In principle, each instance of TIBDatabase or TIBXServicesConnection could use a different version of the library.
Title: Re: IBX 2.3.2 is now available for download
Post by: zoltanleo on December 06, 2018, 05:52:30 pm
Both TIBDatabase and TIBXServicesConnection now include a new property "FirebirdLibraryPathName".
This is great news. Thank you.
Title: Re: IBX 2.3.2 is now available for download
Post by: patyi on December 06, 2018, 11:12:09 pm
Hi all !

How to enable WireCompression protocol ?
Adding WireCompression=True to Connection parameters gives me an error.
I can't find anything about WireCompresson theme in documentation.

Thanks for grate work !
Title: Re: IBX 2.3.2 is now available for download
Post by: tonyw on December 06, 2018, 11:44:39 pm
Hi all !

How to enable WireCompression protocol ?
Adding WireCompression=True to Connection parameters gives me an error.
I can't find anything about WireCompresson theme in documentation.

Thanks for grate work !

IBX can't help you here. Wire encryption has to enabled in the firebird.conf file on both client and server . Also make sure that you are using the Srp authentication scheme. This is the only  scheme that supports wire encryption. For more info see the Firebird 3.0.3 release notes.
Title: Re: IBX 2.3.2 is now available for download
Post by: zoltanleo on December 11, 2018, 11:11:41 pm
Hi.

I tried to install ibx r265. After rebuilding, the IDE showed the following message:
Quote
IBX is unable to locate the Firebird Library - have you remembered to install it?
But tabs with ibx components in the toolbar of IDE I didn't find.

At the same time, I have a Firebird server running as an application:
Code: Pascal  [Select][+][-]
  1. "D:\Portable_program\Firebird_server\Firebird_3_0_3\firebird.exe" -a -p3303

Сan you fix the source code so that your component correctly handles both situations: if server firebird is running as a service or running as an application?
Title: Re: IBX 2.3.2 is now available for download
Post by: tonyw on December 12, 2018, 12:14:08 am
Hi.

I tried to install ibx r265. After rebuilding, the IDE showed the following message:
Quote
IBX is unable to locate the Firebird Library - have you remembered to install it?
But tabs with ibx components in the toolbar of IDE I didn't find.

At the same time, I have a Firebird server running as an application:
Code: Pascal  [Select][+][-]
  1. "D:\Portable_program\Firebird_server\Firebird_3_0_3\firebird.exe" -a -p3303

Сan you fix the source code so that your component correctly handles both situations: if server firebird is running as a service or running as an application?
If you have installed Firebird in a non-standard location on your development system then you have to tell the IDE where to find it by setting the FBLIB environment variable to the flull pathname of the fbclient.dll library.

Under Windows, that is usually done (e.g udner Windows 7) by going to the Control Panel, clicking on "User Accounts" and then clicking on "Change my environment variables".

In the "Environment Variable" dialog, click on the "New" button and enter "FBLIB" as the variable name and the path to the fbclient.dll file as the value. Given your post the value is probably

D:\Portable_program\Firebird_server\Firebird_3_0_3\fbclient.dll

Although this may be different in a non-standard deployment.

Once this is set, you can restart the IDE and hopefully IBX will find the Firebird Libary.
Title: Re: IBX 2.3.2 is now available for download
Post by: incendio on December 12, 2018, 04:24:56 am
Hi all !

How to enable WireCompression protocol ?
Adding WireCompression=True to Connection parameters gives me an error.
I can't find anything about WireCompresson theme in documentation.

Thanks for grate work !

IBX can't help you here. Wire encryption has to enabled in the firebird.conf file on both client and server . Also make sure that you are using the Srp authentication scheme. This is the only  scheme that supports wire encryption. For more info see the Firebird 3.0.3 release notes.

I have enabled WireCompression=true and enable Srp authentication in server side via firebird.conf.
How to enable in client side?

Btw, on client side in windows OS, when using IBX, should Firebird install or it is enough just supply fbclient.dll?
Title: Re: IBX 2.3.2 is now available for download
Post by: dsiders on December 12, 2018, 06:48:04 am
How to enable WireCompression protocol ?
Adding WireCompression=True to Connection parameters gives me an error.
I can't find anything about WireCompresson theme in documentation.

IBX can't help you here. Wire encryption has to enabled in the firebird.conf file on both client and server . Also make sure that you are using the Srp authentication scheme. This is the only  scheme that supports wire encryption. For more info see the Firebird 3.0.3 release notes.

Hello Tony. Sorry for coming late to the thread.

In the release notes, client-side set up is supposedly accomplished by:

Quote
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"

Would that not require isc_dbp_* to include the corresponding option too? I read that it requires zlib1.dll (on Windows) for client-side decompression.

Just curious...

Don
Title: Re: IBX 2.3.2 is now available for download
Post by: zoltanleo on December 12, 2018, 10:30:51 am
Once this is set, you can restart the IDE and hopefully IBX will find the Firebird Libary.
It's doesn't work  even after rebooting the system :'(

And what to do if the system has several FB servers running as an application? This situation is often found on the developer's machine.

ps. If my memory serves me right in the original ibx version of delphi, components are installed and displayed. But when trying to drop TIBDatabase on a form, the developer receives a message "InterBase library gds32.dll not found in the path. Please install InterBase to use this functionality." And it forces him to install the server, define the variable FBLIB, etc.
Title: Re: IBX 2.3.2 is now available for download
Post by: jujibo on December 12, 2018, 11:51:40 am
Once this is set, you can restart the IDE and hopefully IBX will find the Firebird Libary.
It's doesn't work  even after rebooting the system :'(

And what to do if the system has several FB servers running as an application? This situation is often found on the developer's machine.

ps. If my memory serves me right in the original ibx version of delphi, components are installed and displayed. But when trying to drop TIBDatabase on a form, the developer receives a message "InterBase library gds32.dll not found in the path. Please install InterBase to use this functionality." And it forces him to install the server, define the variable FBLIB, etc.

Hi!

Try: Download from firebird site Firebird Zip kit for manual/custom installs for win32 if your lazarus is win32 or x64 if your lazarus is 64 bits.

https://www.firebirdsql.org/en/firebird-3-0/

Extract the files: fbclient.dll,  firebird.conf, firebird.msg, msvcp100.dll and msvcr100.dll  (optional zlib1.dll)

Copy these files in the folder where your lazarus executable is.

All is done, you don't neet do install firebird server. You also need these files for your executable if you want to distribute it as portable. (remember extract the correct version like your executable, 32bit or 64 bits)

Regards
Title: Re: IBX 2.3.2 is now available for download
Post by: zoltanleo on December 12, 2018, 12:24:10 pm
Copy these files in the folder where your lazarus executable is.

All is done, you don't neet do install firebird server. You also need these files for your executable if you want to distribute it as portable. (remember extract the correct version like your executable, 32bit or 64 bits)

For what purpose? You offer me to use embedded firebird, but I have no problems using a full-fledged firebird server. I want to help the author make his component without conditional restrictions. IMHO, it's pretty easy to do. We have already discussed this with the component author here:

http://forum.lazarus.freepascal.org/index.php/topic,40933.msg284673.html#msg284673

But at that moment I couldn't convince him of this. Perhaps I will succeed this time.  ;)
Title: Re: IBX 2.3.2 is now available for download
Post by: jujibo on December 12, 2018, 12:54:35 pm

For what purpose? You offer me to use embedded firebird, but I have no problems using a full-fledged firebird server. I want to help the author make his component without conditional restrictions. IMHO, it's pretty easy to do. We have already discussed this with the component author here:

http://forum.lazarus.freepascal.org/index.php/topic,40933.msg284673.html#msg284673

But at that moment I couldn't convince him of this. Perhaps I will succeed this time.  ;)

The purpose is to fix the error you get: "IBX is unable to locate the Firebird Library - have you remembered to install it?"

If you install in your windows, firebird server 64bits and you run lazarus 32 bits, you'll get this error because the dll's installed in your system are 32 bits. The same happens when you install firebird server 32 bits and un lazarus 64 bits.

In my case, I haven't firebird installed in the windows computer where I develop. I connect to external servers.

I'm not talking about firebird embedded. I'm talking about client/server. In fact, the concept of embedded for firebird 3 changed.

Edited: Well, I see you are looking for another solution :)

Regards.

Title: Re: IBX 2.3.2 is now available for download
Post by: zoltanleo on December 12, 2018, 04:10:09 pm
If you install in your windows, firebird server 64bits and you run lazarus 32 bits, you'll get this error because the dll's installed in your system are 32 bits. The same happens when you install firebird server 32 bits and un lazarus 64 bits.

Yeah. What are you talking about ...  ::)
In my case, I have the x32 firebird client installed and the x32 Lazarus trunk (r59797).

I can post screenshots if it is necessary to make me believe  :D
Title: Re: IBX 2.3.2 is now available for download
Post by: incendio on December 13, 2018, 03:49:28 am
Hi all !

How to enable WireCompression protocol ?
Adding WireCompression=True to Connection parameters gives me an error.
I can't find anything about WireCompresson theme in documentation.

Thanks for grate work !

IBX can't help you here. Wire encryption has to enabled in the firebird.conf file on both client and server . Also make sure that you are using the Srp authentication scheme. This is the only  scheme that supports wire encryption. For more info see the Firebird 3.0.3 release notes.

I think IBX still not supports WireCompression in Firebird 3.

I have tested on Windows OS, Lazarus 1.8.4, and Firebird 3.0.4.

Add SQL to TIBQuery :
Code: Pascal  [Select][+][-]
  1. select RDB$GET_CONTEXT('SYSTEM', 'WIRE_COMPRESSED') as st from rdb$database.
It returns empty, if supported, it should return True.
Title: Re: IBX 2.3.2 is now available for download
Post by: tonyw on December 26, 2018, 04:36:42 pm
How to enable WireCompression protocol ?
Adding WireCompression=True to Connection parameters gives me an error.
I can't find anything about WireCompresson theme in documentation.

IBX can't help you here. Wire encryption has to enabled in the firebird.conf file on both client and server . Also make sure that you are using the Srp authentication scheme. This is the only  scheme that supports wire encryption. For more info see the Firebird 3.0.3 release notes.

Hello Tony. Sorry for coming late to the thread.

In the release notes, client-side set up is supposedly accomplished by:

Quote
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"

Would that not require isc_dbp_* to include the corresponding option too? I read that it requires zlib1.dll (on Windows) for client-side decompression.

Just curious...

Don

Don, you are correct. I got wire compression mixed up wire encryption. There does need to be a minor update to IBDatabase.pas to add the dbp param. I will make this available by svn shortly.
Title: Re: IBX 2.3.2 is now available for download
Post by: tonyw on December 26, 2018, 07:47:31 pm
There is more to the Wire Compression issue than I first thought. The Firebird documentation is confusing and needed some interpretation and testing.

Points of note:

1. My initial post was correct in itself and setting "WireCompression = true" in both client and Server "firebird.conf" files does force wire compression to be on.

2. Adding an isc_dpb_config item to the connection DPB set to "WireCompression=true" will force wire compression from the client side event when the local "firebird.conf" does not include "WireCompression = true".

3. If have no idea where the suggestion came from that executing

select RDB$GET_CONTEXT('SYSTEM', 'WIRE_COMPRESSED') as st from rdb$database

will do anything other than return an error message.

4. According to the "readme" with the Firebird source

"When compression is turned on Z flag is shown in client/server version info – for example: LI-T3.0.0.31451 Firebird 3.0 Beta 1/tcp (fbs)/P13:Z."

I had to search the Firebird-devel list to understand what this meant. In a very useful post back in 2016, the implementor (of wire compression) said "This is requested by isc_version() in legacy API and IUtil::getFbVersion() in new one."

5. I have as a result added the following function to the Firebird Pascal API IAttachment interface:

procedure getFBVersion(version: TStrings);

This seems to be the only way to check whether wire compression is in use, and returns the client/server version information.

6. Referring to item 2 above, adding "WireCompresion=true" to the TIBDatabase params is not going to be a natural way for the client to request wire compression. I have thus added a new published property to TIBDatabase (and to TIBXServicesConnection). This is

WireCompression: boolean;

If this property is set to true then WireCompression will be requested by the client. Note: it is still necessary to include "WireCompression = true" in the firebird.conf file on the server.

7. For an example of how to determine if wire compression is in used, see the ibx/examples/dbInfo example. This prints out the result of calling getFBVersion as part of the database information. Note: this information is the same as IBSQL returns with the "-z" option.

An updated version of IBX incorporating the above is now available from svn. Note: documentation update is to follow. Checkout using

svn co https://svn.mwasoftware.co.uk/public/ibx/trunk



Title: Re: IBX 2.3.2 is now available for download
Post by: dsiders on December 26, 2018, 10:18:31 pm
There is more to the Wire Compression issue than I first thought. The Firebird documentation is confusing and needed some interpretation and testing.

Hi, Tony.

Thanks for your hard work. I'd be glad to help in testing the changes.

3. If have no idea where the suggestion came from that executing

select RDB$GET_CONTEXT('SYSTEM', 'WIRE_COMPRESSED') as st from rdb$database

will do anything other than return an error message.

I'm the source of that misconception. I found it in a StackOverflow conversation about using WireCompression in FireDAC. If I had read a little closer, I would have seen that it is a feature added in Firebird 4.X. I assume to provide a better way of checking it than using the version information. My bad...

An updated version of IBX incorporating the above is now available from svn. Note: documentation update is to follow. Checkout using

svn co https://svn.mwasoftware.co.uk/public/ibx/trunk

Hmm, guess I need to brush some dust off of the SVN skills I haven't used for 15 years. Is Tortoise still the SVN client of choice for Windows?
Title: Re: IBX 2.3.2 is now available for download
Post by: tonyw on December 26, 2018, 11:45:24 pm
There is more to the Wire Compression issue than I first thought. The Firebird documentation is confusing and needed some interpretation and testing.

Hi, Tony.

Thanks for your hard work. I'd be glad to help in testing the changes.

3. If have no idea where the suggestion came from that executing

select RDB$GET_CONTEXT('SYSTEM', 'WIRE_COMPRESSED') as st from rdb$database

will do anything other than return an error message.

I'm the source of that misconception. I found it in a StackOverflow conversation about using WireCompression in FireDAC. If I had read a little closer, I would have seen that it is a feature added in Firebird 4.X. I assume to provide a better way of checking it than using the version information. My bad...

An updated version of IBX incorporating the above is now available from svn. Note: documentation update is to follow. Checkout using

svn co https://svn.mwasoftware.co.uk/public/ibx/trunk

Hmm, guess I need to brush some dust off of the SVN skills I haven't used for 15 years. Is Tortoise still the SVN client of choice for Windows?

Tortoise works but I prefer to use the command line svn for Windows.
Title: Re: IBX 2.3.2 is now available for download
Post by: incendio on December 27, 2018, 02:42:43 am
As I wrote in http://forum.lazarus-ide.org/index.php?topic=43682.0, I use Firebird 3.0.4 to run this command :
Code: Pascal  [Select][+][-]
  1. select RDB$GET_CONTEXT('SYSTEM', 'WIRE_COMPRESSED') as st from rdb$database

Previous version, will return an error.

I have IBDAC + C++ Builder, this IBDAC support WireCompression and it returns TRUE.

I also test it in action, retrieved about 10K rows by 15 columns via internet. zlib1.dll location is the same wtih app, performance difference between with WireCompression and without WireCompression, is quite noticeable.
 
Title: Re: IBX 2.3.2 is now available for download
Post by: dsiders on December 28, 2018, 12:13:33 am
I finally got my install updated to IBX-trunk, and tested with the DBInfo demo.

Success!

Code: [Select]
Firebird/Windows/AMD/Intel/x64 (access method), version "WI-V3.0.4.33054 Firebird 3.0"
Firebird/Windows/AMD/Intel/x64 (remote server), version "WI-V3.0.4.33054 Firebird 3.0/tcp (HP17Z)/P15:CZ"
Firebird/Windows/AMD/Intel/x64 (remote interface), version "WI-V3.0.4.33054 Firebird 3.0/tcp (HP17Z)/P15:CZ"

But it did take a bit of fiddling.

I modified the firebird.conf file for the server to include
Code: [Select]
WireCompression = true.

I also copied zlib1.dll to the directory for the project (dbinfo). I did this because (thanks to Windows DLL-Hell) I already have four other versions of zlib1.dll on my system. I was afraid adding another version to the system path would hose one of the other applications.

I changed the WireCompression property in my TIBDatabase instance to True.

It will not actually use zlib compression until you add zlib to the uses clause in your app. I tried both the .lpk file and the .pas where the TIBDatabase unit resides. Both worked.

Zlib compression cannot be enabled for local connections (XNET). It works for IP addresses (INET). Haven't tried NETBEUI (WNET) yet.

Title: Re: IBX 2.3.2 is now available for download
Post by: dsiders on December 28, 2018, 12:18:45 am
As I wrote in http://forum.lazarus-ide.org/index.php?topic=43682.0, I use Firebird 3.0.4 to run this command :
 
Code: Pascal  [Select][+][-]
  1. select RDB$GET_CONTEXT('SYSTEM', 'WIRE_COMPRESSED') as st from rdb$database

I can confirm that this works on Firebird 3.0.4. Documented in Firebird doc/sql.extensions/README.context_variables2.txt.
Title: Re: IBX 2.3.2 is now available for download
Post by: tonyw on December 28, 2018, 12:55:18 pm
I finally got my install updated to IBX-trunk, and tested with the DBInfo demo.

Success!

Code: [Select]
Firebird/Windows/AMD/Intel/x64 (access method), version "WI-V3.0.4.33054 Firebird 3.0"
Firebird/Windows/AMD/Intel/x64 (remote server), version "WI-V3.0.4.33054 Firebird 3.0/tcp (HP17Z)/P15:CZ"
Firebird/Windows/AMD/Intel/x64 (remote interface), version "WI-V3.0.4.33054 Firebird 3.0/tcp (HP17Z)/P15:CZ"

But it did take a bit of fiddling.

I modified the firebird.conf file for the server to include
Code: [Select]
WireCompression = true.

I also copied zlib1.dll to the directory for the project (dbinfo). I did this because (thanks to Windows DLL-Hell) I already have four other versions of zlib1.dll on my system. I was afraid adding another version to the system path would hose one of the other applications.

I changed the WireCompression property in my TIBDatabase instance to True.

It will not actually use zlib compression until you add zlib to the uses clause in your app. I tried both the .lpk file and the .pas where the TIBDatabase unit resides. Both worked.
I have tried connecting from Windows to a Linux server. In this case, I had no problem enabling wire compression - and with no zlib included in the application. Maybe something about the location of your zlib. I have zlib1.dll in the same folder as the fbclient.dll (default Firebird install).

Zlib compression cannot be enabled for local connections (XNET). It works for IP addresses (INET). Haven't tried NETBEUI (WNET) yet.
Title: Re: IBX 2.3.2 is now available for download
Post by: tonyw on December 28, 2018, 01:00:03 pm
Looking again at the Firebird 3 release notes, it looks like I overlooked the extent of the use of the new DPB item code "isc_dpb_config". This is used at database connection time to provide a list of client side configuration overrides in the same syntax as "firebird.conf". Wire Compression is only one of the overrides that may be applied - e.g. use of Wire Encryption is another. I have added a new property to both TIBDatabase and TIBXServicesConnection to allow client side configuration overrides to be provided. This is now included in the development version of IBX which may be viewed at:

https://svn.mwasoftware.co.uk/viewvc/public/ibx/trunk/

To check out, install subversion and enter the following at a command line (should work on both Windows and Linux).

svn co https://svn.mwasoftware.co.uk/public/ibx/trunk/ ibx

Lazarus 2.0.0 RC3 is recommended for this update, but earlier versions should work.

The corresponding changelog entry is:

IBX Change Log  version (2.3-3 Build 11288) Fri, 28 Dec 2018 10:04:17 +0000

1. New property for TIBDatabase and TIBXServicesConnection. This is "ConfigOverrides"
   and is used to override the default settings in the client side "firebird.conf" This
   includes "WireCompression" and "WireCrypt". The value of this property is a "TStrings".
   Each line of the string list should be a setting in the same format as "firebird.conf".
   For example "WireCompression = true" in order to request wire compression on the client side.

   Note: explicit settings in the client side "firebird.conf" appear to take precedence
   over settings given in TIBDatabase and TIBXServicesConnection. Many client side settings
   also require a compatible setting in the server side "firebird.conf". For example
   "WireCompression = true" must also be set in the server's "firebird.conf" for wire
   compression to be used.

   Whether or not WireCompression or WireCrypt are in use can be checked using the information
   returned with the Client/Server protocol version. See ibx/examples/dbadmin and
   ibx/examples/dbinfo for examples of how to display this information.

2. New property for TIBDatabase and TIBXServicesConnection: "WireCompression". This
   is a "convenience" property. If checked then the setting "WireCompression=true" is added to the
   ConfigOverrides. If unchecked then this setting is removed.

Documentation should now be up-to-date. The TIBDatabase and TIBXServicesConnection property editors are also updated.

Note: with Firebird 3 before 3.0.4, the only way to check whether Wire Compression or encryption is in use is to get the Client/Server version and protocol information using the IAttachment interface method "getFBVersion", and inspect the second and third lines. Both the DBAdmin and DBInfo example applications provide an example of use. The information returned is the same as calling isql with the "-z" option. The second and third lines will end in "Z" is compression is used, "CZ" if both encryption and compression is in use and "C" if encryption only is in use.


Title: Re: IBX 2.3.2 is now available for download
Post by: dsiders on December 28, 2018, 02:28:10 pm

I also copied zlib1.dll to the directory for the project (dbinfo). I did this because (thanks to Windows DLL-Hell) I already have four other versions of zlib1.dll on my system. I was afraid adding another version to the system path would hose one of the other applications.

It will not actually use zlib compression until you add zlib to the uses clause in your app.

I have tried connecting from Windows to a Linux server. In this case, I had no problem enabling wire compression - and with no zlib included in the application. Maybe something about the location of your zlib. I have zlib1.dll in the same folder as the fbclient.dll (default Firebird install).

Updated to 2.3-3 Build 11288.

I tried it with zlib1.dll in the Firebird Library Path and in the application directory. Both worked. And neither required adding zlib to the uses clause.

My database server is on a LAN, so I can't really judge how Wire Compression is affecting throughput... but it is working.
Title: Re: IBX 2.3.2 is now available for download
Post by: incendio on February 04, 2019, 09:33:40 am
I can test it Wire Encription performance on remote server, but how to download the entire folder ibx/trunk ?

And should old IBX 2.3.2 uninstall before install ver 2.3.3?
Title: Re: IBX 2.3.2 is now available for download
Post by: dsiders on February 04, 2019, 06:14:51 pm
I can test it Wire Encription performance on remote server, but how to download the entire folder ibx/trunk ?

I used the instructions in Reply # 22 above. Requires an SVN client. I used Tortoise SVN (for Windows) initially, but decided to use the command line client (Slik SVN).

And should old IBX 2.3.2 uninstall before install ver 2.3.3?

I always remove a previous version, completely scrub the directory structure, and re-install.  Just to avoid any issues. That may be overkill, but it works for me.
Title: Re: IBX 2.3.2 is now available for download
Post by: incendio on February 06, 2019, 04:53:13 am
Have tested new feature WireCompression.

Data size is about 24K rows x 2 col (width = varchar(125)), loading took

Title: Re: IBX 2.3.2 is now available for download
Post by: gerardus on February 12, 2019, 05:59:45 pm
Hi,
I have a set of apps and services wich rely on a framework with DB drivers to access databases.
So far the IBX driver worked flawlessly with IBX 2.2.0 compiled with Lazarus 1.8.4.
I installed Lazarus 2.0 and the Online Package manager installed IBX 2.3.2.
Now I get a SIGSEV error when the app closes.
It happens when the DB driver checks if the transaction is active and tries to commit:

Code: Pascal  [Select][+][-]
  1. procedure TIBXDBConnection.InternalCommit;
  2. begin
  3.   try
  4.     if FTransaction.Active then
  5.       FTransaction.Commit;
  6.   except
  7.   end;
  8. end;
  9.  

TIBXDBConnection is a DB connection wrapper that holds a TIBDatabase and a TIBTransaction.
FTransaction is a TIBTransaction and is valid when this code is executed.

Going back to Lazarus 1.8.4 and IBX 2.2.0 solves the problem, though.
Any idea of what may be wrong?
Title: Re: IBX 2.3.2 is now available for download
Post by: tonyw on February 13, 2019, 01:00:37 pm
I am not sure how Online Package Manager installed IBX 2.3.2 as Online Package Manager is not supported by IBX.

IBX is anyway at 2.3.3. I suggest that you remove all copies of IBX from your PC - as my guess is that you have an inconsistent installation and the install IBX 2.3.3.

Hi,
I have a set of apps and services wich rely on a framework with DB drivers to access databases.
So far the IBX driver worked flawlessly with IBX 2.2.0 compiled with Lazarus 1.8.4.
I installed Lazarus 2.0 and the Online Package manager installed IBX 2.3.2.
Now I get a SIGSEV error when the app closes.
It happens when the DB driver checks if the transaction is active and tries to commit:

Code: Pascal  [Select][+][-]
  1. procedure TIBXDBConnection.InternalCommit;
  2. begin
  3.   try
  4.     if FTransaction.Active then
  5.       FTransaction.Commit;
  6.   except
  7.   end;
  8. end;
  9.  

TIBXDBConnection is a DB connection wrapper that holds a TIBDatabase and a TIBTransaction.
FTransaction is a TIBTransaction and is valid when this code is executed.

Going back to Lazarus 1.8.4 and IBX 2.2.0 solves the problem, though.
Any idea of what may be wrong?
Title: Re: IBX 2.3.2 is now available for download
Post by: gerardus on February 13, 2019, 08:12:20 pm
Hi Toni,
I cleaned up everything, downloaded 2.3.3 and installed it (On Lazarus 1.8.4, Win32)
Same SIGSEGV on exit.
So it must be some change between 2.2.0 and 2.3.2.
For the moment it's back to 2.2.0 as I can't afford to spend more time investigating what's going on.
Title: Re: IBX 2.3.2 is now available for download
Post by: tonyw on February 14, 2019, 04:03:42 pm
Well, I've looked at the changelog and code diffs and can't see anything obvious that could cause a a SIGSERV. Not very much has changed in this area apart from tidying up how starttransaction behaves for single database connection versus multiple database connections - and I can't see how that could affect his.

I believe the most likely reason is an out of step error, especially if you have not removed an earlier version o IBX.

The Lazarus IDE is very sticky when it comes to package references and I am just wondering if you are compiling IBX 2.3.3 using the old version of the low level fbintf package. The way to test this is to open the new package (i.e. ibx/fbintf.lpk) in the iDE before compiling your program with IBX 2.3.3. That will make the IDE choose the new version over the old.
Title: Re: IBX 2.3.2 is now available for download
Post by: gerardus on February 14, 2019, 04:41:46 pm
I shall have a look at it as soon as I have some time, in a clean VM with a fresh Lazarus install.
But I'm pretty sure last time I removed  everything, making sure that I couldn't compile my programs before reinstalling  the 2.3.3 package.
Title: Re: IBX 2.3.2 is now available for download
Post by: Zoran on June 04, 2019, 08:44:22 pm
Hello, Tony
I just checked out the trunk version of IBX and there is a problem currently with package fbintf -- the paths are broken (open fbintf in Lazarus' package editor and you'll see that it cannot see the files).

In 2.3.3, the paths are correct.
I'm attaching the snapshots, comparing trunk and 2.3.3 package options. In trunk version the paths should be prefixed with "fbintf\", like they are in 2.3.3.

EDIT:
Now I see that not only paths listed in "other unit files" edit box (which I surrounded in red) are wrong, but also paths in "include files", as well as "unit output directory". This can be also seen on attached screenshot.
Title: Re: IBX 2.3.2 is now available for download
Post by: Zoran on June 04, 2019, 09:02:21 pm
Sorry, I was too fast.
Not enough, actually, just to change paths.
The files were moved, reorganized, so should be added again to the package, one by one.
Title: Re: IBX 2.3.2 is now available for download
Post by: tonyw on June 05, 2019, 12:17:34 am
Apologies. Looks like a step was missing in the script that performed the last update.

The correct version of fbintf.lpk is now available in trunk
Title: Re: IBX 2.3.2 is now available for download
Post by: Zoran on June 05, 2019, 12:02:15 pm
Thank you, Tony.
Title: Re: IBX 2.3.2 is now available for download
Post by: Zoran on June 06, 2019, 08:25:47 pm
Hello, Tony,

I think that IBX's strategy of finding the client library path should be changed.

Please allow me to explain my today's experience:

On my Windows 7 computer, I just couldn't make IBDatabase connect.
I tried on Linux and had no problems. I tried on another computer with Windows, and it also just worked without problems.

Both these Windows machines have the same FB version installed, both have fbclient.dll of the same version (3.0.4) in System32 directory.

On both machines, FlameRobin connects without problems.
On both machines other libraries in Lazarus (I tried SQLdb and Zeos) connect without problems.

I had no idea what it could be, then, I tried to give client dll path expicitely, and I was surprised that it worked:
Code: Pascal  [Select][+][-]
  1. procedure TForm1.Button1Click(Sender: TObject);
  2. begin
  3.   // Only with this line, the connection was succesfull:
  4.   IBDatabase1.FirebirdLibraryPathName := 'C:\Windows\System32\FBCLIENT.DLL';
  5.  
  6.   IBDatabase1.DatabaseName := 'localhost/3053:employee';
  7.  
  8.   IBDatabase1.Params.Values['lc_ctype'] := 'UTF8';
  9.   IBDatabase1.Params.Values['user_name'] := 'sysdba';
  10.   IBDatabase1.Params.Values['password'] := 'masterkey';
  11.  
  12.   IBDatabase1.Connected := True;
  13. end;
  14.  

However, I know that, if IBX didn't see any client library, the components would not appear in component palette at all. Hence, it does see it.

Then I found it -- apart from FB 3.0.4, I have FB 2.5 engine installed on same machine. They use different ports.
What should matter is that the client library installed in system directory is fbclient 3.0.4.

However, there was still fbclient.dll 2.5 inside folder where FB 2.5 engine is installed. When I removed it, everything started to work, without setting the client path explicitely.

Yes, the old FB 2.5 engine is installed in default location (C:\Program files\Firebird\... etc.), and FB 3.0 is not, but that should not matter. The two services listen to different ports, and again, only newer client is installed in system folder, which is why other client utilities make their connections through it.

I could accept that the application's folder might have priority over system folder (and that is still questionable, if a programmer wants to distribute client library in application folder, he knows what he is doing and he can set FirebirdLibraryName to current directory in code).

Anyway, I strongly believe that client library which is installed in system folder must have priority over default installation folder of FB engine.

My customer could even have older Firebird server installed on current machine, but want to connect to different server which has newer FB engine. He should just install newer client, no need to touch his old server installation -- newer client library connects to older server, but the older cannot connect to new FB engine.

Don't you agree?
Title: Re: IBX 2.3.2 is now available for download
Post by: tonyw on June 08, 2019, 04:03:20 pm
Zoran,

"DLL Hell" is one of the many pleasures(?) of using Windows. As you noted, things are just so much simpler under Linux. I first published about 15+ years ago the algorithm used by IBX to locate the FBCiient library under Windows and it's documented in the "Firebird Pascal API Guide" in section 3.2.2.

Briefly, the algorithm first looks in the installation folder. This is because installing the Firebird Client library along with the application follows MS guidelines (my understanding) and is the best way to avoid stealth upgrades and downgrades. This is the first action because this is what you expect in a production system.

The alogrithm next checks the registry. If Firebird has been installed using one of the official installers, then the registry key is set to the Firebird installation directory and that's where IBX will look next. This is typical of a development system where a Firebird Server has been installed alongside Lazarus and you want it available to all of your development applications.

After that you are really more into trying to get something to work in a broken system where Firebird has not been correctly installed. IBX checks well known installation folders, and then only then tries use the PATH variable. This is when it will find FBCLIENT.DLL if it is in "System32". Finally, in desperation, IBX looks for "gds32.dll". I assume that in your case, it picked up the Firebird 2.5 client DLL because it was in a well known location. Flamerobin probably skips this step.

"System32" is a bad place to locate any third party DLL. I'm sure I recall Microsoft advising against it. There are, for example, no naming conventions to make sure that someone else doesn't come along and over-write your DLL with a totally different one.

The good news is that as you observed, IBX does allow you to explcitly specify which FBClient.DLL you want when the one you want is not the one returned by the search algorithm. However, I do believe that the correct sequence is:

1. Installation folder (production systems)

2. Folder given by Firebird Registry Key (development systems).

3. Go though well known Firebird installation folders in order of Firebird 3 and downwards.

4. Finally use the PATH.

5. Give up and assume InterBase

The last three are really for non-standard installations and undofrunately, IBX cannot always second guess what you intend.

Title: Re: IBX 2.3.2 is now available for download
Post by: Zoran on June 09, 2019, 12:02:38 am
Thank you, for thorough answer.
Title: Re: IBX 2.3.2 is now available for download
Post by: incendio on June 15, 2019, 01:35:57 pm
Hi guys,

I tried IBX 2.3.3 on Lazarus 2.0.2 on Linux Mint 19.1.

The Project file was a modified version of multi threading example from Lazarus.

When Step Over the project (pressed F8), got an error :
The file build/glibc-otsel5/glibc-2.27/elf/dl-error-skeleton.c was not found.

The codes is something like this
Code: Pascal  [Select][+][-]
  1. // on Datamodule unit, class name DtM
  2. type
  3. Conn1: TIBDatabase;
  4. Q5: TIBQuery;
  5.  
  6. // On MainUnit.Pas
  7. DtM.Conn1.Close;
  8. DtM.Conn1.Open
  9. DtM.Q5.Close;
  10. DtM.Q5.SQL.Clear;
  11. DtM.Q5.SQL.Add('.....');
  12. DtM.Q5.Open;
  13.  

Error when DtM.Conn1.Open called. On Database Editor, test connection on Conn1 was succesfull.

Without Step Over, project runs OK.

So is this error from IBX or Lazarus?

Edited Jun,17,2019
This is not IBX problem, most likely it is from Lazarus.
Title: Re: IBX 2.3.2 is now available for download
Post by: Zoran on June 16, 2019, 02:04:35 pm
Hello, Tony,

I remember that for a short period there used to be the bugtracker on mwa site, but it dissappeared after a while.
Would you think about the "official" place where IBX should be discussed?
Instead of maintaing the bugtracker yourself, you might ask for a subforum in Lazarus forum, like some other libraries have. Probaby, a dedicated subforum here would be more suitable for IBX.

For example, TAChart (https://forum.lazarus.freepascal.org/index.php/board,55.0.html), BGRA (https://forum.lazarus.freepascal.org/index.php/board,46.0.html) have their place under Graphics; then, fpspreadsheet (https://forum.lazarus.freepascal.org/index.php/board,49.0.html), RichMemo (https://forum.lazarus.freepascal.org/index.php/board,71.0.html) have their subforums under Packages and Libraries.
For these libraries, this is the right place for asking questions and reporting bugs.

IBX is a big library, have been actively developed and maintained for several years already.
I don't know if there are some conditions that need to be satisfied for getting the subforum, but surely IBX has significance for FPC/Lazarus community which is not smaller than significance of some other libraries which have its own subforums, so in my opinion it deserves its own place here.
It could be placed either under Packages and Libraries (https://forum.lazarus.freepascal.org/index.php/board,42.0.html) or under Databases (https://forum.lazarus.freepascal.org/index.php/board,16.0.html).

What do you think?
Title: Re: IBX 2.3.2 is now available for download
Post by: Zoran on June 16, 2019, 02:14:37 pm
So is this error from IBX or Lazarus?

I think that there is more that you can do yourself before asking community:

First, try the same with SQLdb controls instead of IBX. Does the same problem appear?
If the answer is yes, then this is FPC or Lazarus problem and should be reported to the bugtracker.

If not, then prepare the application which shows the problem, as simple as possible. Upload this sample application here, instead of just code snippets. Tony will surely try to answer this eventually, but please first you try to do your best to help debugging.
Title: Re: IBX 2.3.2 is now available for download
Post by: zoltanleo on August 16, 2019, 08:43:54 pm
Hello, Tony

Thank you for developing your components. And special thanks for giving the user the opportunity to freely choose the server client library. I have been waiting for this for a very very long time  :D

Now I'm trying to use your components again (from OPM for laz r61706).

In my OS (Windows 7), several 32-bit FB servers are launched as applications (e.g.  "D:\Portable_program\Firebird_server\Firebird_2_1_7\bin\fbserver.exe" -a -p 3217). I'm trying to create a simple database connection with this code:
Code: Pascal  [Select][+][-]
  1. const
  2.   DBName: String = 'localhost/3217:D:\Archive\Databases\general_base\GENERAL_BASE_1903_25.FDB';
  3.   ClientLib: String = 'd:\Portable_program\Firebird_server\Firebird_2_1_7\bin\fbclient.dll';
  4. begin
  5.   with IBDatabase1 do
  6.   begin
  7.     DatabaseName:= DBName;
  8.     FirebirdLibraryPathName:= ClientLib;
  9.     Params.Add('user_name=SYSDBA');
  10.     Params.Add('password=cooladmin');
  11.     Params.Add('lc_ctype=WIN1251');
  12.     LoginPrompt:= False;
  13.   end;
  14.   try
  15.     IBDatabase1.Connected:= True;
  16.   except
  17.     on E:EIBInterBaseError do
  18.     begin
  19.       ShowMessage(e.Message);
  20.       IBDatabase1.Connected:= False;
  21.     end;
  22.   end;
  23.  
  24.   if IBDatabase1.Connected
  25.     then
  26.       Self.Caption:= 'Connection on'
  27.     else
  28.       Self.Caption:= 'Connection off';
  29. end;

сauses a connection error  :o
Quote
Project project1 raised exception class 'EIBInterBaseError' with message:
Your user name and password are not defined. Ask your database administrator to set up a Firebird login

In file 'D:\Archive\development\lazarus_21_r61706_ibxlaz\_config\onlinepackagemanager\packages\ibx\runtime\nongui\IBDatabase.pas' at line 1141

If you change the connection string and the client library (e.g. for FB 3.0.4.)
Code: Pascal  [Select][+][-]
  1. DBName: String = 'inet4://127.0.0.1:3304/D:\Archive\code_source\bases\ARMDOC_5000_UNICODE_FB3.FDB';
  2. ClientLib: String = 'D:\Portable_program\Firebird_server\Firebird_3_0_4\fbclient.dll';
  3. ...
  4. Params.Add('lc_ctype=UTF8');
  5. ...
then connection errors do not occur.

At the same time, the same connection parameters in IBExpert (http://www.ibexpert.net/ibe/) do not cause any error (see both screenshots for each case).

Can you comment on this situation?

UPDATE: Obviously, the "old" IBX packages are in the OPM repositories. I installed IBX r.288 and the error went away.

Thank you again for developing the component. :)
Title: Re: IBX 2.3.2 is now available for download
Post by: Vingadero on August 20, 2019, 10:43:09 pm
Hello,

I got this version to test and noticed that the "Modified" property is not setting to true after making a change to an TDBEdit component.

Code: Pascal  [Select][+][-]
  1. if DBEditID.Modified then
  2. begin
  3.   ...
  4. end;

Also the OldValue and NewValue of TField get always the last value.

Code: Pascal  [Select][+][-]
  1. if DBEditID.Field.OldValue <> DBEditID.Field.NewValue then
  2. begin
  3.  ...
  4. end;

I'm usung Lazarus 2.0.4 and IBX 2.3.2 (tried 2.3.3 from site and got same issues).

****EDIT: Just to know, on IBX 2.0-3 it's works perfectly ****

Best Regards
TinyPortal © 2005-2018