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

Network programming - troubles 1

Status
Not open for further replies.

parslej

Programmer
Nov 21, 2001
40
PL
Hello!
I have big problems in programming to te network use. I wrote an aplication. Placed in server, and all user run it by te LAN (I don't know - maybe better will be if they run it from your own local drives and only database will be shared ?). Application works well but when users run queries they often see words "attempting to lock..." and they can waiting, and waiting and nothing happends - when they press ESC applications goes down...

I use on all forms Private Data Session but in the mlutiply use application works not good...

Night mare is to me words "Attemting to lock..."

So, The main question is: "can anybody give me short recept to network programming ?"
 
Hi..
What you are asking is too much to explain in short. But in short, the following guidance may be taken.

1. If you are using pessimistic buffer mode... change it to optimistic buffr mode.
2. If you are using table buffering... dont use that.... make it to row buffer.
3. If you are explicitly, locking rcords... make sure that your locks are placed and removed with no user interaction in between... That is to say... you lock only whn a record is to be written.. Dont lock.. allow the usr to edit and then write and unlock.. this is a bad habit. Get the user write in a buffered row or memory variables.. and then lock and commit the work and unlock it. So no user will lock and hold the others.
4. If you are using begin transaction ... end transaction... same as in 3 above.

Hope these concepts help you :)
ramani :-9
(Subramanian.G),FoxAcc, ramani_g@yahoo.com
 
The problem you have doesn't have anything to do with the EXE file residing on the server. That's actually the way my project is run.

The first thing I would check is your table buffering modes and be sure you issue TableUpdates if you're using buffering. The message you're getting usually means that the current user is trying to update a record that another user has locked already. If you're using manual record locking, make sure you release those locks under ALL circumstances when you return.

 
Tnx
I use change optimistic buffer mode... I thought that if I swith to Private Datasession - VFP will do everything without my help - if I correct understand - I should use transaction or code record locking myself ?
 
What you have to watch out for is making modifications to records or adding new records when buffering and leaving those changes uncommitted.

A private data session only prevents multiple forms within the same VFP session from corrupting each other's data. It won't affect multiple users on the network.

With buffering, be sure you issue your TableUpdate() commands properly. Others would be able to give much better advice since I've never used buffering myself.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top