Hello.
I have Lazarus 1.0.10 + FPC 2.6.2 on win32.
Also, Informix 11 Developer.
Database:
* Base
Table:
* Places
. ID int (PK)
. sDesc char(80)
Controls:
* TODBCConnection
. Name: Conn1
. FileDSC: c:\App\Inf01.dsn
. User & Password setted ok.
. Transaction: Trans1
* TSQLTransaction
. Name: Trans1
. Database: Conn1
* TSQLScript (to insert some new registers)
. Name: sqlSC
. Database: Conn1
. Transaction: Trans1
. Script: My insert sentence
I have a function with this code section to execute my insert sentence:
try
Trans1.StartTransaction;
sqlSC.Execute;
Trans1.Commit;
ShowMessage('Inserted OK');
except
on E:Exception do
begin
Trans1.Rollback;
ShowMessage('Error:'#13#10#10+E.Message);
end;
My insert sentence is very simple, like this:
* INSERT INTO Places (ID, sDesc) values (3,'Place 1');
Ok. When I insert a new row whithout a problem (whithout syntax errors, with no PK conflicts, etc, it work just fine.
But if I make a syntax error, or when y try to insert a duplicated ID, the program freezes for 2 minutes waiting for the exception. In 2 minutes an EODBCException is thrown.
Also, sometimes I make an INSERT with ID conflict just to try, and no exception is thrown as if the sentence INSERT would work ok. But actually no insert occurs, of course.
Any clue ??