-
Notifications
You must be signed in to change notification settings - Fork 38
Implement locking of indexed files. #690
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement locking of indexed files. #690
Conversation
* set the transaction mode to EXCLUSIVE * set busy_timeout to 5000
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This pull request implements comprehensive file-locking and record-locking functionality for indexed files in the COBOL system. It adds multi-process synchronization capabilities to prevent data corruption and ensure consistency when multiple processes access the same indexed files simultaneously.
- Implements file-level locking to control access modes (preventing multiple OUTPUT mode access)
- Adds record-level locking with MANUAL/AUTOMATIC modes and WITH LOCK/WITH NO LOCK clauses
- Introduces extensive test coverage for various concurrency scenarios
Reviewed Changes
Copilot reviewed 28 out of 30 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/run.src/miscellaneous.at | Adds test for opening invalid formatted indexed files |
| tests/indexed-lock.src/*.at | Comprehensive test suite for file and record locking scenarios |
| tests/indexed-lock.at | Main test orchestrator for indexed file locking tests |
| tests/Makefile.in, tests/Makefile.am | Build configuration updates to include new test suite |
| tests/.gitignore | Git ignore rules for new test artifacts |
| libcobj/.../IndexedCursor.java | Complete rewrite of cursor implementation for better concurrency support |
Comments suppressed due to low confidence (1)
tests/indexed-lock.src/access-different-record.at:1
- The word 'rewrited' should be 'rewritten' - the past tense of rewrite is rewritten.
AT_SETUP([Record locking of indexed files (different records)])
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
libcobj/app/src/main/java/jp/osscons/opensourcecobol/libcobj/file/IndexedCursor.java
Outdated
Show resolved
Hide resolved
libcobj/app/src/main/java/jp/osscons/opensourcecobol/libcobj/file/IndexedCursor.java
Show resolved
Hide resolved
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This pull request adds file-locking and record-locking of indexed files.
File Lock
The specifications of flie-locking of indexed files are bellow.
LOCK MODE clauses in SELECT clauses
-lock-mode-automatic, a new command line option, changes the default value of LOCK MODE to AUTOMATIC.Record Lock
WITH LOCKnorWITH NO LOCK,WITH LOCK, the runtime attempts to lock the record.WITH NO LOCK, the runtime does not attempt to lock locks the record.