Discussion:
Linux & RLOCK()
(too old to reply)
Debbie
2006-03-16 16:20:47 UTC
Permalink
Recently, a client changed his operating system to Linux. Since then, they
have started to get duplicate order numbers in the VFP back-office system we
designed for them. The system was written in VFP 7.0 and uses RLOCK() in
the code to get the next available order number. The code used is as
follows:

*-- Get next available number
DO WHILE !RLOCK("ordernumber")
LOOP
ENDDO
lcOrderNumber = ALLTRIM(STR(ordernumber.norder))
REPLACE ordernumber.norder WITH (ordernumber.norder + 1) in ordernumber
=TABLEUPDATE(0,.T.,"ordernumber")
UNLOCK IN ordernumber

It seems that RLOCK() might not be working as I expect it to under this
operating system, but I'm not sure why. I am not experiencing this problem
with any other clients, but none of my other clients are running Linux.
Does anyone here know of any problems with VFP and Linux?

Thanks - Debbie
Dan Freeman
2006-03-16 18:24:38 UTC
Permalink
Ummmm .... VFP runs in Windows. Only.

Do you mean they're running a Linux file server? I can see that being
problematic if the network redirector doesn't support locking the same way
for that Linux fileserver.

Dan
Post by Debbie
Recently, a client changed his operating system to Linux. Since
then, they have started to get duplicate order numbers in the VFP
back-office system we designed for them. The system was written in
VFP 7.0 and uses RLOCK() in the code to get the next available order
*-- Get next available number
DO WHILE !RLOCK("ordernumber")
LOOP
ENDDO
lcOrderNumber = ALLTRIM(STR(ordernumber.norder))
REPLACE ordernumber.norder WITH (ordernumber.norder + 1) in
ordernumber =TABLEUPDATE(0,.T.,"ordernumber")
UNLOCK IN ordernumber
It seems that RLOCK() might not be working as I expect it to under
this operating system, but I'm not sure why. I am not experiencing
this problem with any other clients, but none of my other clients are
running Linux. Does anyone here know of any problems with VFP and
Linux?
Thanks - Debbie
Debbie
2006-03-16 21:20:36 UTC
Permalink
Hi Dan

Yes, it's a Linux file server and the data files all reside on a partition
of the server. The users are either on Windows 2000 or Windows XP
workstations. How would I find out what type of locking is supported, and
do you have any suggestions on how I could resolve this matter?

Thanks - Debbie
Post by Dan Freeman
Ummmm .... VFP runs in Windows. Only.
Do you mean they're running a Linux file server? I can see that being
problematic if the network redirector doesn't support locking the same way
for that Linux fileserver.
Dan
Post by Debbie
Recently, a client changed his operating system to Linux. Since
then, they have started to get duplicate order numbers in the VFP
back-office system we designed for them. The system was written in
VFP 7.0 and uses RLOCK() in the code to get the next available order
*-- Get next available number
DO WHILE !RLOCK("ordernumber")
LOOP
ENDDO
lcOrderNumber = ALLTRIM(STR(ordernumber.norder))
REPLACE ordernumber.norder WITH (ordernumber.norder + 1) in
ordernumber =TABLEUPDATE(0,.T.,"ordernumber")
UNLOCK IN ordernumber
It seems that RLOCK() might not be working as I expect it to under
this operating system, but I'm not sure why. I am not experiencing
this problem with any other clients, but none of my other clients are
running Linux. Does anyone here know of any problems with VFP and
Linux?
Thanks - Debbie
"Olaf Doschke" <T2xhZi5Eb3NjaGtlQFNldG1pY3MuZGU@strconv.14
2006-03-16 21:58:30 UTC
Permalink
Post by Debbie
Yes, it's a Linux file server and the data files all reside on a partition
of the server. The users are either on Windows 2000 or Windows XP
workstations. How would I find out what type of locking is supported, and
do you have any suggestions on how I could resolve this matter?
There were known issues with the Foxpro locking mechanism and Samba.
Samba had errors in it's locking mechanism. We had no more problems,
since we use Samba 3.0.14a.

If Samba is up to date it can be something very simple as misconfiguration
within smb.conf, eg locking = no should be changed.

Bye, Olaf.
Debbie
2006-03-17 13:38:13 UTC
Permalink
After more conversations with their network engineer yesterday, it seems
that this client also experienced problems with another multi-user
application they run (QuickBooks) and were getting duplicate records with
that too. The guy didn't elaborate on what he had done to resolve the
issue, nor did he tell us what version of Samba he had installed, but we
will certainly contact him again later this morning and pass along what you
have said.

Thanks, Olaf - Debbie
Post by "Olaf Doschke" <***@strconv.14
Post by Debbie
Yes, it's a Linux file server and the data files all reside on a
partition of the server. The users are either on Windows 2000 or Windows
XP workstations. How would I find out what type of locking is supported,
and do you have any suggestions on how I could resolve this matter?
There were known issues with the Foxpro locking mechanism and Samba.
Samba had errors in it's locking mechanism. We had no more problems,
since we use Samba 3.0.14a.
If Samba is up to date it can be something very simple as misconfiguration
within smb.conf, eg locking = no should be changed.
Bye, Olaf.
Debbie
2006-03-16 22:08:37 UTC
Permalink
Dan, my apologies, but...

We have just managed to track down the client's network engineer and it
seems our client misinformed us. They are not running a Linux file server
as we were originally told. They are running a Unix file server and have
Samba installed on top of that to interface with the Windows OS workstations
and run their Microsoft applications.

How would that setup affect my VFP RLOCK() code?

Thanks again - Debbie
Post by Dan Freeman
Ummmm .... VFP runs in Windows. Only.
Do you mean they're running a Linux file server? I can see that being
problematic if the network redirector doesn't support locking the same way
for that Linux fileserver.
Dan
Post by Debbie
Recently, a client changed his operating system to Linux. Since
then, they have started to get duplicate order numbers in the VFP
back-office system we designed for them. The system was written in
VFP 7.0 and uses RLOCK() in the code to get the next available order
*-- Get next available number
DO WHILE !RLOCK("ordernumber")
LOOP
ENDDO
lcOrderNumber = ALLTRIM(STR(ordernumber.norder))
REPLACE ordernumber.norder WITH (ordernumber.norder + 1) in
ordernumber =TABLEUPDATE(0,.T.,"ordernumber")
UNLOCK IN ordernumber
It seems that RLOCK() might not be working as I expect it to under
this operating system, but I'm not sure why. I am not experiencing
this problem with any other clients, but none of my other clients are
running Linux. Does anyone here know of any problems with VFP and
Linux?
Thanks - Debbie
Dan Freeman
2006-03-16 22:16:02 UTC
Permalink
I have no idea, but I'd be Talking To that network guy. <s>

I've never used Samba, but I know several who hang here have so maybe one of
them will chime in.

Dan
Post by Debbie
Dan, my apologies, but...
We have just managed to track down the client's network engineer and
it seems our client misinformed us. They are not running a Linux
file server as we were originally told. They are running a Unix file
server and have Samba installed on top of that to interface with the
Windows OS workstations and run their Microsoft applications.
How would that setup affect my VFP RLOCK() code?
Thanks again - Debbie
Post by Dan Freeman
Ummmm .... VFP runs in Windows. Only.
Do you mean they're running a Linux file server? I can see that being
problematic if the network redirector doesn't support locking the
same way for that Linux fileserver.
Dan
Post by Debbie
Recently, a client changed his operating system to Linux. Since
then, they have started to get duplicate order numbers in the VFP
back-office system we designed for them. The system was written in
VFP 7.0 and uses RLOCK() in the code to get the next available order
*-- Get next available number
DO WHILE !RLOCK("ordernumber")
LOOP
ENDDO
lcOrderNumber = ALLTRIM(STR(ordernumber.norder))
REPLACE ordernumber.norder WITH (ordernumber.norder + 1) in
ordernumber =TABLEUPDATE(0,.T.,"ordernumber")
UNLOCK IN ordernumber
It seems that RLOCK() might not be working as I expect it to under
this operating system, but I'm not sure why. I am not experiencing
this problem with any other clients, but none of my other clients
are running Linux. Does anyone here know of any problems with VFP
and Linux?
Thanks - Debbie
Loading...