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

Record locking using NFS Unix files 1

Status
Not open for further replies.

gonzalezceci

Programmer
Apr 8, 2002
1
AR
We are using Power COBOL V4, and testing a program we realized that , although we are using the "READ WITH LOCK" sentence, it has no effect if several Fujitsu COBOL programs are accessing to the same record.

After several tries we detected that running the same program on a file located on the C: or on a file located on the WNT net, the lock function correctly.
Only when the file is located on the NFS Unix (we are working with Unix Sun Solaris V 5.5.1)the programs do not detect that other program is locking the record.
 
I do not know about locking on a NFS file sistem, but I experienced that on the WNT net it lock too much:
I found a record locked by another user even if that user was not still reading the same record (but he read it sometime before). Definitely I do not love Fujistu's locking mechanism. RM locking was very much better.
May be we have not well understood how Fujistu lock mechanism work, so I invite someone of Fujitsu to partecipate to this thread and to explain better this aspect of their comiler, if they follow this forum (but I do not think so).
Fujitsu's cobol gurus, please partecipate on this thread : it is a good point of discussion.
 
NFS does not support that kind of I/O operations. I've read that on a Micro Focus site once. That's why Micro Focus has FS (File Share). Acu also has a simular product. Don't know about Fujitsu.

Record locking on network disks is always risky. I've tested once wiht 2 NT workstations sharing a disk on a OS/2 server. Starting a stress-test resulted in a BSOD on the server. I was tempted to try the same test on the NT-based prodcution network (the OS/2 machine was only a test-server). But the fact that a few hundred co-workers depend on that network kept me from it.... I am bad, but not that bad
 
TruusVlugindewind,

Thanks for your answer; really interesting.
What the best, in your opinion, if you need to work with cobol indexed files on a M$ PCs network and a samba server?
Our main applications work with an Oracle database placed on a unix System V server, but sometimes I prefer minor applications work with cobol files to not overload our database and give some more work to our linux server.
Until now application with cobol files work locally on PCs but in the future I'll be forced to place them on samba server for sharing archives.
Have you ever tried it? What about oplock=yes and oplock=no on smb.conf? May be cobol lock will wotk when oplock=no (that is no Windows opportunistic lock).

Thanks for your cooperation.
 
My advice? Micro Focus Server Express for Unix or Linux (announced only a few weeks ago). Their FS product acts as if it were a DBMS. It handles all the I/O requests from the network-clients (also optimizing network traffic).
Those clients run cobol programs and the I/O is coded in normal COBOL syntax. To ensure data consistency you can commit or rollback mutations.

I am sorry I cannot answer your Samba questions. Don't know enough of it.

Another thing I found out in this context:
When you access files on a NT-server you can code:

select bestand assign to "//ntserver/share/subdir/file".

This code looks cool and works.
But when you just do a normal "net use x: //blablabla"
and in cobol: "assign to x:\subdir\file" it performs a lot better. Don't know why, but especially the "close" takes a lot of time using the 'cool' code.

Please keep me informed about your progress
 
TruusVlugindewind,

FS seem very good, especially for commit and rollback features.
Thanks for your answer.
 
i'm working with fujitsu cobol(ver.5) and Oracle(8.1) db, and i can't insert records into a table with fields that they have numeric fields with decimals.
host variable: 01 var1 pic S9(08)V99 COMP-3.
db field : amount number(10,2) (value 50.66)
when i want to retrieve data from db, the value of host variable is 0000506600 ,,,why this? ,, i don't understand,
when i want to insert a record ,,i receive the next message:
sqlstate 22005 ora-01722 invalid number,,

help me please,,,
 
Are you sure you have not inconsistency between decimal point and comma?
If you use the DECIMAL-POINT IS COMMA clause and you try to send to oracle a value 50.66 it's likely you receive that error. (You must send 50,66)
 
Hi Cesaruco

You need to declare your host-variable as:

01 var1 COMP-2.

Hope in this help

Gianni
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top