#1 2013-12-21 21:09:25

martin.suer
Member
Registered: 2013-12-15
Posts: 76

SynDBUniDAC TSQLDBUniDACConnectionProperties constructor parameter

Hi,

I want to use the UniDAC library for firebird access.

In the constructor of the class TSQLDBUniDACConnectionProperties

Create(const aServerName, aDatabaseName, aUserID, aPassWord: RawUTF8);

 
mormot really is using the first parameter aServerName for what UniDAC names their provider (e.g. Oracle, Interbase, etc).

Due to that, I have no means to pass a server name to be used with firebird. Mormots implementation only works with embedded Firebird but not with Firebird on a different DB-Server.
Looking at the code I can see that in TSQLDBUniDACConnection.Create either fDatabase.Database or fDatabase.Server is set (depending on the DBMS) but not both.

Using Firebird on an external server requires to set both.

For the moment I can help myself by changing the TSQLDBUniDACConnection.Create by adding these two lines at the end:

if fDatabase.SpecificOptions.Values['Server']<>'' then
    fDatabase.Server := fDatabase.SpecificOptions.Values['Server'];

Then I can create my TSQLDBUniDACConnectionProperties this way:

aProps := TSQLDBUniDACConnectionProperties.Create(
    'Interbase',
    'mormot',
    'SYSDBA', 'masterkey');
  aProps.SpecificOptions.Values['Server'] := '10.211.55.2';

But I think this should only be a temporary workaround.
Mormot should change the TSQLDBUniDACConnectionProperties constructor by adding a provider parameter instead of using the aServerName parameter for it.

What do you think?

Martin

Last edited by martin.suer (2013-12-21 21:12:19)

Offline

#2 2013-12-22 12:57:12

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,238
Website

Re: SynDBUniDAC TSQLDBUniDACConnectionProperties constructor parameter

You are right.

We have added server name in TSQLDBUniDACConnectionProperties.URI(), able to specify a server name for UniDAC connection.
In fact, we can not change the TSQLDBUniDACConnectionProperties.Create() signature, without breaking all SynDB units.
The solution here is similar to what we have done with other kind of connections.
See http://synopse.info/fossil/info/a6894b2bba

About UniDAC and FireBird, I'm quite sure it will be much slower than using Zeos/ZDBC 7.2:

{
        "ClassName":"TStat",
        "Engine": "ZEOS Firebird",
        "CreateTableTime": "236.74ms",
        "NumberOfElements": 5000,
        "InsertTime": "506.21ms",
        "InsertRate": 9877,
        "InsertBatchTime": "501.05ms",
        "InsertBatchRate": 9979,
        "InsertTransactionTime": "250.51ms",
        "InsertTransactionRate": 19958,
        "InsertBatchTransactionTime": "228.76ms",
        "InsertBatchTransactionRate": 21856,
        "ReadOneByOneTime": "338.42ms",
        "ReadOneByOneRate": 14774,
        "ReadAllVirtualTime": "78.68ms",
        "ReadAllVirtualRate": 63546,
        "ReadAllDirectTime": "60.05ms",
        "ReadAllDirectRate": 83255,
        "ClientCloseTime": "70us"
    },
    {
        "ClassName":"TStat",
        "Engine": "UniDAC Firebird",
        "CreateTableTime": "123.34ms",
        "NumberOfElements": 5000,
        "InsertTime": "957.86ms",
        "InsertRate": 5219,
        "InsertBatchTime": "874.75ms",
        "InsertBatchRate": 5715,
        "InsertTransactionTime": "47.22s",
        "InsertTransactionRate": 105,
        "InsertBatchTransactionTime": "7.82s",
        "InsertBatchTransactionRate": 639,
        "ReadOneByOneTime": "2.76s",
        "ReadOneByOneRate": 1808,
        "ReadAllVirtualTime": "85.41ms",
        "ReadAllVirtualRate": 58537,
        "ReadAllDirectTime": "64.33ms",
        "ReadAllDirectRate": 77720,
        "ClientCloseTime": "70us"
    }

Offline

#3 2013-12-22 19:25:20

martin.suer
Member
Registered: 2013-12-15
Posts: 76

Re: SynDBUniDAC TSQLDBUniDACConnectionProperties constructor parameter

Excellent.

Thank you.

Offline

Board footer

Powered by FluxBB