Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Mike Yearwood
  Where is Mike Yearwood?
 Toronto
 Canada
 Mike Yearwood
 To: Frank Cazabon
  Where is Frank Cazabon?
 
 Trinidad And Tobago
 Frank Cazabon
 Tags
Subject: RE: System hangs when other PC connects
Thread ID: 311089 Message ID: 311199 # Views: 42 # Ratings: 2
Version: Visual FoxPro 9 SP2 Category: Errors & Debugging
Date: Wednesday, June 29, 2011 4:20:55 PM         
   


> > Hi,
> >
> > I have an application that I recently installed at a client's site on their network. The PCs are part of a work group. The data is installed in one PC's Public Folder and access granted to the other PCs. Each PC has its own executable on its hard drive and I believe is running Windows Vista.
> >
> > The PC with the data on it runs fine all the time.
> >
> > The other PC runs fine if the first PC is not running the application. If the first PC is running the app and I try to start the app on the second PC, it hangs, if the app is shutdown on the first PC at this point in time, the second PC then continues to run. If the second PC runs the app first and then the first PC starts the app, the second PC will run for a little while fine, then it will "hang" until we shut down the app on the first PC then continue along fine.
> >
> > If I had to guess, this looks like some sort of SET REPROCESS thing, but nothing is opened exclusively nor locked as far as I know and the application runs fine on other networks (I think they have a third PC so I will try to get them to bring that one into the mix and see what happens).
> >
> > Update: I tried to duplicate the problem on my hardware unsuccessfully
> >
> > Does anyone have any idea what could possibly cause this?
> >
> > Frank.
> >
> > Frank Cazabon
> > Samaan Systems Ltd.
> > www.SamaanSystems.com
>
> I have disabled SMB2 on all PCs involved and so far this seems to have fixed the problem, but the user will monitor it today and report back.
>
> Frank.
>
> Frank Cazabon
> Samaan Systems Ltd.
> www.SamaanSystems.com

You describe the classic opportunistic locking OPLOCKS scenario. I got to play with this at a client extensively. I had 4 PCs to play with and a Windows Server 2008. If the first pc (with the data files) is accessing the tables via a mapped drive or UNC, it basically gets exclusive access - Windows "prefers" this, thinking that a user is opening a Word or Excel document on the server. Once the second machine accesses the file, the first machine must dump all caches and change to shared access. Time-consuming with ll the caching VFP does. If machines 2 and 3 were to access machine one at the same time, both 2 and 3 will wait while machine one switches. If the first machine is not using a drive map or UNC, it uses the files without involving SMB2. However, if machine 2 started the app first, and machine one then accesses using UNC or mapping, it will experience the same delay. If it is not using UNC or mapping, I bet it will still have to wait, but I'm not sure. Never thought to check that.

Definitely disable oplocks everywhere. Disable write caching too. Share any MS documentation with their IT people. It's all fine and dandy with single user files, but it's not fine for shared access files. Obviously, none of this is an issue with a SQL Server database. Makes me wonder about SQL Express. That is Access isn't it? Is a "server" installed because that would by-pass oplocks.

I also hope that machine one is the "administrator" of your application and not using UNC/mapping. That way a reindex can be lightning fast.

Mike Yearwood
Microsoft MVP Visual FoxPro 2008, 2009
We have enough youth. We need a fountain of smart!
There may be many ways to skin a cat, but there are very few right ways to do it.

ENTIRE THREAD

System hangs when other PC connects Posted by Frank Cazabon @ 6/28/2011 6:51:38 PM
RE: System hangs when other PC connects Posted by Yahia Aboudalal @ 6/29/2011 9:54:04 AM
RE: System hangs when other PC connects Posted by Frank Cazabon @ 6/29/2011 1:55:27 PM
RE: System hangs when other PC connects Posted by Frank Cazabon @ 6/29/2011 3:07:34 PM
RE: System hangs when other PC connects Posted by Mike Yearwood @ 6/29/2011 4:20:55 PM
RE: System hangs when other PC connects Posted by Frank Cazabon @ 6/29/2011 5:55:19 PM