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 John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to know if table is still in use? 6

Status
Not open for further replies.

Mandy_crw

Programmer
Jul 23, 2020
587
PH
Hi experts... i dont know, i consider my app as finish, but everytime I use it, there is always that i see to be added... so here i go again to ask...

Since my app is in the server computer, sometimes the server computer is being closed first, so the client computer that uses the table in the server displays an error message when app ive created is closed or when used , because table are already closed in the server... Pleas teach me or show me how or give me suggestion to avoid this... is there a way to know that there are still using the table? Thanks and God bless....
 
Chriss said:
CLOSE DATATBASES or pretty much ANY command only acts in the process it executes. It does NOT close tables and databases for all, just for itself.

Oh I see... You mean when i close the databse in the client computer it doesnt necesarily mean that i have closed all access to the file server? All the while I thought when the app closes the data to the client computer everything is also closed... Thanks Chriss....
 
Mandy,

This is a long shot. I'm sure you understand if the "server" shuts down (i.e. power off) the clients can no longer access its data.

HOWEVER: If you can't control WHEN the server operator "pulls the plug" in your situation and you need the clients to STILL access the data after server disconnect, you need to think about an alternate way to handle your data.

As much as I think having more than one data set is horrible, you might have to think about creating a second set of data on server shutdown. I have done this for a client who needed a current data set to run the app on her laptop to take home where there was no connection to the server.

Of course the server needed to be updated with her changes when she returned to the office. That worked ok in this case, but I could see a possible nightmare if others changed data before she returned.

I don't know your exact situation, but it might be something to think about.

Steve
 
Steve said:
If you can't control WHEN the server operator "pulls the plug" in your situation and you need the clients to STILL access the data after server disconnect, you need to think about an alternate way to handle your data.

Well, in short you need a server. A Server that only serves as a server, not also a workstation. And if your application is for a small peer group, that might be as little as a NAS, network attached drive. Which nobody shuts down unintentionally, at least.

Someone sitting at the computer you chose to have the server role likely just has the habit of powering it off. And at the days he leaves last that also won't disturb anyone. You don't get that out of people, even if you tell them their workstation is the data storage for all. Even if you tell them to please keep their computer on with or without the reason for it.

NAS can be the smallest servers you can add to your network and can schedule to shut down or go in energy savings mode.

Of course you shouldn't then make the mistake of adding the NAS into the network by connecting it to one of the workstations, the NAS would be connected to a router everyone else also connects to.

Chriss
 
Chris said:
...you need a server.

Yes, that is the optimal solution. I have clients that cannot afford (or won't spend) the cost of a dedicated server and its setup & maintenance. I only offered the suggestion of my not-so-desirable workaround because I think the OP (and possibly others) might be in that situation.

But you are right. Life is much simpler with a real server!

Steve
 
It's understandable from the costs perspective, but then the user working on the "server" workstation can easily become the problem.

The cheapest solution I can think of is a SoC system like a raspberry or Arduino acting as a server. If the database files or on a drive that's not the OS dirve of that workstation, you won't even need a new drive. If the workstation or any of them has a drive that can be emptied by copying over files to other drives/partitions, you can use this one drive for your self-built NAS.


Mandy said:
...the error shows when the app is open in the client, then the server is shutdown first... cannot access file... understandable because the file server is no longer on...
Awareness is the first step to a solution.

Mandy, this should clear it up. You don't have problems with data sessions crossing or such things. If the server shuts down, of course file access is gone. One problem with it is, that errors won't pop up immediately when that computer shuts down. If a user on another client saves, or scrolls to a record not yet read from a DBF file or causes any access operation to a DBF, then such errors pop up. Not directly.

But of course this will eventually happen, for sure, even if all other users also just close their applications, when closing the data that's also file access. So you have guaranteed errors.

Chriss
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top