Page 1 of 1

postgresql issues

Posted: Mon 18 May 2015 13:07
by swierzbicki
Hello,

I have a Datamodule with one UniConnection component. This connection is shared between a worker thread object (listening a TCP server within a thread every 500ms) and the main program (user's action). This is well working when using an SQLite provider. I'm getting a lot of exceptions when working with the PostgreSQL provider.

'first chance' Exception at $757F812F. Exception Class Exception with a message 'Invalid parameters specified'
'first chance' Exception at $757F812F. Exception class EPgError with a message 'Unexpected server response:' '
'first chance' Exception at $757F812F. Exception Class Exception with a message 'Invalid parameters specified'
'first chance' Exception at $757F812F. Exception class EPgError with a message 'Unexpected server response:' '
'first chance' Exception at $757F812F. Exception class EUniError with a message 'Unexpected server response:' '
Loading module: DUser.dll. No debug information. Base address: $74360000
Exception 'first chance' at $757F812F. Exception class EAssertionFailed with a message 'Assertion failure (D:\Projects\Delphi\Dac\PostgreSql\Source\PgSQLProtocol.pas 2321 line)

My software must run with a SQLite database or a postgreSQL database.

Re: postgresql issues

Posted: Mon 18 May 2015 17:50
by FCS
Hello,

As I remember topics from this forum, if you use thread application each thread needs to have its own UniConnection.

Regards
Michal

Re: postgresql issues

Posted: Tue 19 May 2015 06:57
by swierzbicki
As I remember topics from this forum, if you use thread application each thread needs to have its own UniConnection.
This will maybe solves postgresql issues but I'll then get SQLite "Database is locked" errors !

Re: postgresql issues

Posted: Tue 19 May 2015 08:45
by azyk
FCS is right. A separate TUniConnection instance must be used for each thread in a multi-threaded application.

For this, you can create TUniConnection components for each thread in the Datamodule - and pass each TUniConnection component to its thread. You can also create a separate TUniConnection instance in each thread at run-time.

Re: postgresql issues

Posted: Tue 19 May 2015 13:49
by swierzbicki
My WorkerThread is now creating an TUniConnection at runtime for anything else then SQLite provider.

I'll test this and report any problem

Re: postgresql issues

Posted: Fri 22 May 2015 13:12
by swierzbicki
Hello,

Dispite having created a new TUniConnection object within my thread, I'm ramdomly getting :
'first chance' Exception at $7514812F. Exception Class EPgError with message 'Unexpected server response :
Anyone at Devart can enlight me where to start debugging this ?

Re: postgresql issues

Posted: Mon 25 May 2015 08:29
by azyk
Could you send a small sample reproducing the described exception to andreyz*devart*com?

Re: postgresql issues

Posted: Tue 26 May 2015 08:57
by swierzbicki
Hello Andrey,

I'll will try a reproducible pattern. Right now I don't know why this is happening and how to reproduce it.

Best regards,

Stéphane WIERZBICKI

Re: postgresql issues

Posted: Wed 27 May 2015 12:23
by azyk
We will wait for your sample. If you have any additional questions concerning UniDAC, please contact us.