Assertion Failure - PgSQLProtocol.pas, Line 2240

Discussion of open issues, suggestions and bugs regarding PgDAC (PostgreSQL Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
rodrigo.mgsys
Posts: 4
Joined: Wed 16 May 2012 15:43

Assertion Failure - PgSQLProtocol.pas, Line 2240

Post by rodrigo.mgsys » Wed 16 May 2012 17:10

I'm getting this error when I try to debug, only with brake points.
Error: Assertion Failure - PgSQLProtocol.pas, Line 2240

The error happens only when the cursor goes at a pgDac procedure or function.
If we are not on debug mode or if the brake point is after a interaction with pgDac, everything works fine.
Does pgDac comes with debug information?

Enviroment:
Windows 7
Delphi XE2 Update 4
PgDac Standard Edition

If you need more information or a sample code, let me know.

rodrigo.mgsys
Posts: 4
Joined: Wed 16 May 2012 15:43

Re: Assertion Failure - PgSQLProtocol.pas, Line 2240

Post by rodrigo.mgsys » Wed 16 May 2012 17:17

One more information, only running on debug mode (F9) sometimes i'm getting this the same error.
With brake point the error always happens, without I didn't found the situation, but sometimes happens. You click ok on error message, try again and then, no error.

rodrigo.mgsys
Posts: 4
Joined: Wed 16 May 2012 15:43

Re: Assertion Failure - PgSQLProtocol.pas, Line 2240

Post by rodrigo.mgsys » Wed 16 May 2012 23:04

One more database error:
Socket error or Read: WSAgetLastError return 10004 ($2714)

ROD
Devart Team
Posts: 23
Joined: Mon 07 May 2012 09:09

Re: Assertion Failure - PgSQLProtocol.pas, Line 2240

Post by ROD » Thu 17 May 2012 09:25

Hi,

When I try to reproduce the problem (including debug and breakpoints), the Assertion Failure does not occur.
Your example code would be useful here. And, please, also specify the protocol (TPgConnection.ProtocolVersion) and the version of PostgreSQL you are using.

Concerning the database error 10004, it may occur when referring to a closed socket.
http://www.zxro.net/uncategorized/fix-10004/

rodrigo.mgsys
Posts: 4
Joined: Wed 16 May 2012 15:43

Re: Assertion Failure - PgSQLProtocol.pas, Line 2240

Post by rodrigo.mgsys » Tue 22 May 2012 14:25

I found the problem.
In the main form there was a thread executing a select each second to check the server connection.
When I disabled the thread the error does not happen any more.

I found the problem when I tried to migrate the application to Interbase.

Any sugestion to work with PgDac and threads. Do I need a new connection for each thread?

Thank you for attention.

ROD
Devart Team
Posts: 23
Joined: Mon 07 May 2012 09:09

Re: Assertion Failure - PgSQLProtocol.pas, Line 2240

Post by ROD » Tue 22 May 2012 16:04

Hi,

Yes, the right way to work in a multithreaded application is to have connection (the TPgConnection) in each thread.

Post Reply