The Java™ program can lock a file to prevent other users
from accessing the file while the first Java program is using the file.
Lock types are as follows. You can find more information about
the lock types in the AS400File Javadoc.
- Read/Exclusive Lock - The current Java program reads records, and no other
program can access the file.
- Read/Allow shared read Lock - The current Java program reads records, and other programs
can read records from the file.
- Read/Allow shared write Lock - The current Java program reads records, and other programs
can change the file.
- Write/Exclusive Lock - The current Java program changes the file, and no other
program can access the file.
- Write/Allow shared read Lock - The current Java program changes the file, and other
programs can read records from the file.
- Write/Allow shared write Lock - The current Java program changes the file, and other
programs can change the file.
To give up the locks obtained through the lock() method, the Java program
starts the releaseExplicitLocks() method.