Transaction: Cursor PORTAL...... already exists

Discussion of open issues, suggestions and bugs regarding PgDAC (PostgreSQL Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
yapt
Posts: 69
Joined: Mon 16 Mar 2009 12:06

Transaction: Cursor PORTAL...... already exists

Post by yapt » Sun 12 Apr 2009 09:40

Hello,

Environment:
- PgDac 1.10.0.5
- PostgreSQL 8.3
- Platform: windows


I have a master-detail insertions on a Transaction.

Table2 -> MasterDetail -> Table1

Ie:

Connection.StartTransaction;
Table1.Append;
(fill fields)
Table1.Post;
//--
:1
Table2.Append;
(here I have a TPgQuery to get the last line on Table2)
(SELECT max line+1 FROM t2 where .....)
(Set parameters for that TPgQuery)
(Open -or refresh- TPgQuery)
Table2.FieldByName.. := TPgQuery.fieldbyname('...').AsInteger;
Table2.Post;
: GOTO 1:
Connection.Commit;


When I do the First TPgQuery.Open (or refresh) all is ok, but when I go to :1 (append a new line) and re-open (refresh here) the TPgQuery I get a EPgError Exception:

'Cursor 'PORTALST1375588814' already exists';

I have only found this on my google search:
http://www.postgresql.org/docs/6.4/stat ... eclare.htm

What is this and how to avoid this error ?

Greetings.

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Mon 13 Apr 2009 07:24

We could not reproduce the problem. Please send to pgdac*devart*com a complete small sample that demonstrates the problem, including the script for creating database objects.

yapt
Posts: 69
Joined: Mon 16 Mar 2009 12:06

Post by yapt » Mon 13 Apr 2009 11:07

As I said you by mail at pgdac*devart*com, I have found the problem:

Setting AutoPrepare on Query does the trick.

Somebody read pgdac*devart*com ?

yapt
Posts: 69
Joined: Mon 16 Mar 2009 12:06

Post by yapt » Mon 13 Apr 2009 11:12

yapt wrote:
Somebody read pgdac*devart*com ?
My guilty I think. I have not put my license number on mail to pgdac*devart*com

:?

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Tue 14 Apr 2009 12:00

We have fixed this problem. The fix will be included in the next build of PgDAC.

Post Reply