Board index » delphi » BDE problems with lost network connection - revisited

BDE problems with lost network connection - revisited

Hi guys,

I don't want to beat this subject to death, but I happened across some more
information today, and I thought I'd post it for more consideration.

Recently, I posted a message concerning getting a blue screen of death when
the connection to a network database was lost.  I created a simple test
program with Delphi 4 Professional/Update 2 and BDE 5.01.  All this program
does is open a Paradox table and display it in a grid.  While the program is
running, I remove the network connection (actually, I'm running on Windows
NT, and I've just mapped a different drive letter to my own hard drive, so
there's no physical network, but it works the same).  If I try to scroll
through the grid after I disconnect the mapped drive, I get a BDE exception
just like I would hope.

Now here's the kicker.  If I quit the program, it looks like it shuts down
fine, but it's still listed in the Task Manager.  Even if I start the
program, disconnect the mapped drive, and immediately quit (without getting
a BDE exception), the program continutes to show up in the task manager.

Any ideas on what I might be able to do to try to completely close down?
Direct BDE API calls, etc.?

-Eric Harmon [TPX]

 

Re:BDE problems with lost network connection - revisited


I'm slowly getting more information on this.  Here's exactly what's going
on:

When the application closes, I don't explicitly close the database session.
So after the main form is destroyed, the VCL automatically closes the
database sessions.  Down inside the VCL code, the calls to
TBDEDataSet.DestroyHandle (DbiRelRecordLock and DbiCloseCursor) and
TSession.StartSession (DbiCloseSession) take literally several minutes per
call to complete.  Apparently, the three Dbi calls each wait for a timeout
before returning.

Is there any way that I can either shorten the timeout period right before
exiting the program, so this won't be a problem?  Or any other way to get
around this that anyone can think of?

-Eric Harmon

Re:BDE problems with lost network connection - revisited


This is an interesting issue that I would also like to know...

I am writing a program that is supposed to run all the time (24 hrs / 7
days) gathering informations from a serial port and store it in database.

Client's Network sometimes down because of power interruptions (they put UPS
on the server but not on the HUB.. yeah smart isn't it ?)

So in order to test it, I work on my home network (of two computers
connected by a coax cable) and put the tables on the other computer
accessing it through UNC. I just tried to unplug the cable and my program
freezes.

any way to prevent this ? I have put the update code in a try..except block
but seems like it still freezes.

Regards,
Jimmy

Re:BDE problems with lost network connection - revisited


Quote
>any way to prevent this ? I have put the update code in a try..except block
>but seems like it still freezes.

No. Not with the standard file server configuration where every client connects
directly to the tables.  You may want to post this question in the mulit-Tier
section I belive you could handle this in a multi Tier application.

--
Brian Bushay (TeamB)
Bbus...@NMPLS.com

Other Threads