Assertion Failure

Discussion of open issues, suggestions and bugs regarding usage of dbExpress drivers for PostgreSQL in Delphi and C++Builder
Post Reply
Costa.Magno
Posts: 4
Joined: Mon 13 May 2013 19:05

Assertion Failure

Post by Costa.Magno » Mon 13 May 2013 19:15

I have the component in version Version 3.1.2, recently acquired.
But I'm having a lot of problems in Delphi XE3 with error "assertion failure":
First chance exception at $ 74F2C41F. EAssertionFailed class Exception with message 'Assertion failure (D: \ Projects \ Delphi \ Dac \ PostgreSql \ Source \ PgSQLProtocol.pas, line 2244)'.

I have an example, if not able to reproduce the error.

DemetrionQ
Devart Team
Posts: 271
Joined: Wed 23 Jan 2013 11:21

Re: Assertion Failure

Post by DemetrionQ » Tue 14 May 2013 12:33

Hello.

I have tested your example.
The problem is due to the fact that you are using the same TSQLConnection in different threads without synchronization. To solve the problem, you should either create its own TSQLConnection for each thread, or perform access to the DB from threads via the Synchronize method. You can read more detailed information about thread synchronization in the Embarcadero documentation.

Costa.Magno
Posts: 4
Joined: Mon 13 May 2013 19:05

Re: Assertion Failure

Post by Costa.Magno » Tue 14 May 2013 13:05

Hello...
Thank you.
Which method would be more feasible in your view?

Magno.

DemetrionQ
Devart Team
Posts: 271
Joined: Wed 23 Jan 2013 11:21

Re: Assertion Failure

Post by DemetrionQ » Tue 14 May 2013 15:08

The difference between the specified methods is that, on synchronization of threads, the operations executed via Synchronize are executed in the main threads, freezing the thread, that called Synchronize, while synchronization is being performed.
If you want to work with DB really in parallel, then it will be suitable for you to create separate TSQLConnections for each thread.

Costa.Magno
Posts: 4
Joined: Mon 13 May 2013 19:05

Re: Assertion Failure

Post by Costa.Magno » Tue 14 May 2013 22:52

Ok thanks for the feedback.

DemetrionQ
Devart Team
Posts: 271
Joined: Wed 23 Jan 2013 11:21

Re: Assertion Failure

Post by DemetrionQ » Wed 15 May 2013 08:17

If any other questions come up, please contact us.

Best regards,
Demetrion
Devart Team

Costa.Magno
Posts: 4
Joined: Mon 13 May 2013 19:05

Re: Assertion Failure

Post by Costa.Magno » Tue 28 May 2013 13:53

Good day.
I'm using a server datasnap for my application and the concomitant use of forms still having the same problem, and almost impossible to use the system.

DemetrionQ
Devart Team
Posts: 271
Joined: Wed 23 Jan 2013 11:21

Re: Assertion Failure

Post by DemetrionQ » Wed 29 May 2013 14:33

Hello.

I couldn't reproduce the problem.
I created datasnap server and client applications (similar to the ones described in the blog: http://blogs.devart.com/dac/index.php/u ... pment.html ) and used dbExpress Driver for PostgreSQL to connect to the database - everything works fine.

Please describe the problem in more details or send a simple sample demonstrating the problem to dmitryk*devart*com.

Post Reply