Subject Re: database reconnect techniques
Author Adam
--- In firebird-support@yahoogroups.com, "Si Carter"
<simon.carter@...> wrote:
>
> > -----Original Message-----
> > I have a D7 app which communicates with FB1.5 using IB Objects.
> >
> > I'd like to add the following:
> >
> > 1. Automatically check if database is available (network
> > connectivity or other issues)...
> >
> > 2. Once connection is terminated for any reason, try to reconnect.
> >
> > What is the preferred technique to do this? Should i use some
> > sort of timer or a thread?
>
> You could use the AfterDisconnect event to trigger a timer/thread
which will
> keep trying to reconnect.

Although it is worth remembering that most of the VCL is not
threadsafe (not sure about IBO but I know others are not). By all
means run a timer in a separate thread, but make sure you don't try
and access the same database object from both the main thread and
another thread.

Adam