Page 1 of 1

Access Violation in trigger constraint

Posted: Fri 17 Sep 2010 18:37
by Claudio
Version Delphi: 2010 (Update 5)
Version Postgres: libpq 8.4.4 (64)
Version Devart: 1.0.8
Server: SLACKWARE 13.1 - (64)

Windows 7

...
...
try
connection.commitfreeandnil(transaction);
except
connection.rollbackfreeandnil(transaction); <--- ACCESS VIOLATION

---- DATABASE -------------------------------------------------------------
create table test (id serial not null primary key, field text);

create or replace function ft_const_trig() returns trigger as $$
begin
raise exception 'error';
return null;
end;$$ language plpgsql;

create constraint trigger ft_constraint_trigger after insert or update or delete on test
deferrable initially deferred for each row execute procedure ft_const_trig();

Posted: Mon 20 Sep 2010 08:09
by AlexP
Hello,

Please, send me a more detailed piece of code or a sample project so that I could reproduce the problem.

Code

Posted: Mon 20 Sep 2010 15:09
by Claudio
Hello,


var
Transaction: TDBXTransaction;
begin
Table.Open;
Table.Edit;
Table.FieldByName('field').AsString := 'test';
Table.Post;

Transaction := connection.BeginTransaction(TDBXIsolations.ReadCommitted);
try
Table.ApplyUpdates;
connection.commitfreeandnil(transaction);
except
connection.rollbackfreeandnil(transaction); <--- ACCESS VIOLATION
end;

end;

Posted: Tue 21 Sep 2010 11:26
by AlexP
Hello,

Thank you for the information.
We will fix this bug in one of the next builds.

Posted: Tue 02 Nov 2010 08:21
by bork
Hello

We have fixed this problem. This fix will be included in the next dbExpress driver for PostgreSQL build.