Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Database server connection problem

Status
Not open for further replies.

prundle

Technical User
Jul 22, 2002
5
GB
We are running lifetests using an application written in Delphi 5 which uses BDE to save data to Paradox tables held on a server.

If the connection to the server is lost or the server goes down then the application locks up requiring a reboot.

I have tried enclosing the code that writes data to the tables in try..except blocks but this doesn't help.

Any help with this problem appreciated.

Pat
 
Try to make use of the TDatabase component, and let this handle all the connections to the server. It looks like you are writing to the database by code, make use of the components like TUpdateSQL, TQuery etc, they handle problems more gracefully like written code. Steven van Els
SAvanEls@cq-link.sr
 
I am now using the TDatabase component as suggested so that all transactions should go via this component. However the problem remains. If I use the TDatabase component how do I protect against server disconnects?
 
I think you have a hardware problem, when my server goes down, delphi comes up with message box, informing that the server is unavailable. Did you test your network card? Can you ping the server? Do you have power fluctuations? Why does the server goes down in the middle of a transaction? Steven van Els
SAvanEls@cq-link.sr
 
At the moment I am using a second workstation to look at the problem but with the same result. We may well have a problem with the network/network cards but I am reproducing the problem by simply unplugging the network cable from the wall socket. If I do ths then I get no indication (message box) and the application simply locks (task manager reports 'not responding'). I don't understand why Delphi doesn't raise an exception in these circumstances.

Pat
 
What version of Windows and network protocol are you running on the client?
What happens if you ping the server after you unplug the cable (without your application running)? --
Robert
 
The client uses Windows 98 with TCP/IP as the network protocol. If I ping the server with the cable unplugged I get 'Request timed out' (four tries). Ping works with the cable plugged in

Pat
 
The fact that you are using a server suggests to me that you have more than one user accessing the DataBase.

In which event perhaps you should be thinking of not using Paradox to begin with. Because Paradox's
"pessimistic locking" will prevent more than one user accessing the same table at one time. Which can lead to
problems if you have a number of users.

This was the reason why I switched to using .GDB tables accessed by an Application Server. Which "serves" all the "ThinClients" you want. Even if you have only one on one PC. And in any event data-manipulation using SQL is a lot more effective.

My six-pence worth. :)
 
I take your point - the more I use the Delphi database stuff the more I question the advisability of doing it this way.
That said we haven't noticed any problems with multiple access. Users are usually entering data to different tables of the database, whereas many users are browsing the entire database simultaneously. This seems to work ok.
What bugs me is that pulling the network cable out just locks the application - I just don't understand why this doesn't raise an exception.

Pat

 
This may not help

I have been drafted in to help develop a multi-user DB system that was using Paradox.

Convert to ADS (Advantage) it is easy and very stable with a snooth upgrade path to client server
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top