postgresql issues

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
swierzbicki
Posts: 451
Joined: Wed 19 Jan 2005 09:59

postgresql issues

Post by swierzbicki » Mon 18 May 2015 13:07

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.

FCS
Posts: 176
Joined: Sat 23 Feb 2013 18:46

Re: postgresql issues

Post by FCS » Mon 18 May 2015 17:50

Hello,

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

Regards
Michal

swierzbicki
Posts: 451
Joined: Wed 19 Jan 2005 09:59

Re: postgresql issues

Post by swierzbicki » Tue 19 May 2015 06:57

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 !

azyk
Devart Team
Posts: 1119
Joined: Fri 11 Apr 2014 11:47
Location: Alpha Centauri A

Re: postgresql issues

Post by azyk » Tue 19 May 2015 08:45

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.

swierzbicki
Posts: 451
Joined: Wed 19 Jan 2005 09:59

Re: postgresql issues

Post by swierzbicki » Tue 19 May 2015 13:49

My WorkerThread is now creating an TUniConnection at runtime for anything else then SQLite provider.

I'll test this and report any problem

swierzbicki
Posts: 451
Joined: Wed 19 Jan 2005 09:59

Re: postgresql issues

Post by swierzbicki » Fri 22 May 2015 13:12

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 ?

azyk
Devart Team
Posts: 1119
Joined: Fri 11 Apr 2014 11:47
Location: Alpha Centauri A

Re: postgresql issues

Post by azyk » Mon 25 May 2015 08:29

Could you send a small sample reproducing the described exception to andreyz*devart*com?

swierzbicki
Posts: 451
Joined: Wed 19 Jan 2005 09:59

Re: postgresql issues

Post by swierzbicki » Tue 26 May 2015 08:57

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

azyk
Devart Team
Posts: 1119
Joined: Fri 11 Apr 2014 11:47
Location: Alpha Centauri A

Re: postgresql issues

Post by azyk » Wed 27 May 2015 12:23

We will wait for your sample. If you have any additional questions concerning UniDAC, please contact us.

Post Reply