Question

I've been working on a project with Java on openVMS. To get right to it, my program reads a file and calls some SOAP services. I implemented log4j like normal and here is where my problem begins. It appears when my log file is opened by my program/log4j, an exclusive lock is placed on the file. We can't even tail it to see the contents. The only time you can view the file is when the process completes. With that said, my question is has anyone done any logging like this on VMS or does a better solution come to mind that I should look at.

Was it helpful?

Solution

Before you start your application, that is before the "java" command,

$ DEFINE/USER JAVA$FILE_OPEN_MODE 3
$ DEFINE/USER JAVA$FSYNC_INTERVAL 5

Where the open mode 3 ensures that the file is shared (not locked) and the 5 seconds interval ensures EOF is updated. Obviously you can change the number of seconds to any other useful value. Small values may reduce the overall I/O performance. Also, keep in mind, that these settings affect all file operations done by your Java application.

This works for 1.5.0-8 (VMS numbering scheme) and should work for other recent versions as well.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top