transaction and lost connection

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
direct_mki
Posts: 2
Joined: Wed 28 Jul 2010 07:48

transaction and lost connection

Post by direct_mki » Wed 28 Jul 2010 08:08

Hi

i am using MyDAC 5.90.0.59 and delphi 5

i have a transaction that is completely executed and committed but nevertheless i got a "lost connection" exception in delphi sometimes. the exception is raised from the commit statement in delphi, but all SQLs are executed (and commited!) in database.

any ideas?

Michael

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Wed 28 Jul 2010 09:35

Connection can be lost because of unstable network. To process lost connection you should use the LocalFailover mode and handle the OnConnectionLost event. You can find more detailed information about these properties in the MyDAC help.

direct_mki
Posts: 2
Joined: Wed 28 Jul 2010 07:48

Post by direct_mki » Wed 28 Jul 2010 12:17

OK, but in the line before the commit i have a connection.ping without an error.
And: the SQLs (Inserts, Updates, etc.) in database ARE committed afterwards

How should I proceed then after the OnConnectionLost event? I can not reexecute my SQLs if they are already executed. I have no information about the commit has succeeded.

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Wed 28 Jul 2010 15:19

I can not reproduce the problem. Please send me a complete small sample to dmitryg*devart*com to demonstrate it, including a script to create and fill table.

Post Reply