Delphi Pages Forums  

Go Back   Delphi Pages Forums > Delphi Forum > General

Lost Password?

Thread Tools Display Modes
Old 07-31-2018, 09:50 PM
Marsheng Marsheng is offline
Senior Member
Join Date: Nov 2008
Posts: 314
Default Compliler options 6 vrs 10

I've migrated to ver 10 from 6. I do have one issue other than the
exceptionally busy IDE !!!

I use MydAC from Devart. In version 6, the connectionlost on the DB connection
was fired whenever the connection was lost and reconnected seamlessly. Running
from IDE environment in 6, the lost connection brought up the actual error if
the 'report errors' was enabled. Once compiled and ran as a stand alone EXE,
the lost connection was seamless. Just reconnected whenever a connection was
lost and the user was unaware of the issue.
In 10 however, even if I set the compiler to Release, the error pops up.
Accepting the error, the program reconnects and all is fine. How to I suppress
the error message ?

PS this is the best Delphi forum for answers. Thanks chaps.
Reply With Quote
Old 08-30-2018, 04:45 AM
Marsheng Marsheng is offline
Senior Member
Join Date: Nov 2008
Posts: 314

After many hours trying to find a solution, I'm going back to Delphi 6.
Reply With Quote
Old 08-30-2018, 08:27 AM
Norrit Norrit is offline
Join Date: Aug 2001
Location: Landgraaf
Posts: 7,323

Since DevArt is a vendor you could try and ask there.

As for their information on this:

And then the remarks sound interesting:
Write the OnConnectionLost event handler to process fatal errors and perform failover.

Note: To use the OnConnectionLost event handler, you should explicitly add the MemData unit to the 'uses' list and set the TCustomDAConnection.Options.LocalFailover property to True.
But when is this message that pop's up triggered, before or after the event is raised?
And perhaps it's just as simple as including some more information when in release mode (Assuming that when running in Debug without the IDE, so compile in debug and run the .exe, will not raise this)
Reply With Quote
Old 08-31-2018, 12:50 AM
Marsheng Marsheng is offline
Senior Member
Join Date: Nov 2008
Posts: 314

Tried devart several times and submitted a ticket but no joy.

When I run a local server, I don't get the problem. It would seem that when connected to Crazydomain's DB, it will drop the connection after about 10 minutes in in activity.

In 6, when ever an event was then activated after a dropped connection, the OnConnectionLost was automatically triggered and all continued without any disruption.

In 10, the event that fails is reported to the screen, on accepting the error, the OnConnectionLost is triggered and then all continues as above.
Reply With Quote
Old 08-31-2018, 12:43 PM
rojam rojam is offline
Senior Member
Join Date: Jun 2015
Posts: 194

If you are connecting to a remote database, I wouldn't keep an active connection to the database. Do the connection, run the operation (query, update, insert) and disconnect.

If you still want to persist the connection, did you try using the Application's OnException event? Drop a TApplication on your main form, select the OnException Event, write code to handle that specific exception. Be aware that if you don't specify which exception, then ALL previously un-handled exceptions will be handled by this event.
Reply With Quote
Old 09-19-2018, 10:53 AM
Marsheng Marsheng is offline
Senior Member
Join Date: Nov 2008
Posts: 314

I found a command. Now I use a ttimer and ping the server every 2 minutes.

Seems to have solved the problem.
Reply With Quote

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump

All times are GMT. The time now is 02:43 AM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2019, vBulletin Solutions, Inc.