Commit f984a89
Implement locking of indexed files. (#690)
* add: processUuid and processId
* add: create a new table `file_lock`
* refactor: suppress PMD warnings
* fix: sql statement creating a new table `file_lock`
* wip: wip
* fix: a PMD warning
* fix: a SpotBug warning
* refactor: remove printStackTrace()
* fix: check formats of indexed files to open
* test: remove unnecessary checks
* fix: change constants to avoid overlaps
* fix: add a file existing check
* test: fix the test of opening an invalid indexed file
* test: fix load.at not to call default error handlers
* chore: end a transaction
* refactor: CobolIndexedFile.java
* test: prevent infinite loops
* refactor: CobolIndexedFile.java
* wip: wip
* fix: improve open_ in CobolIndexedFile.java
* change: set transaction settings
* set the transaction mode to EXCLUSIVE
* set busy_timeout to 5000
* feat: implement file locks of indexed files
* fix: change the condition of creating file_lock
* change: set the transaction isolation to SERIALIZABLE
* test: add tests of file locking of indexed files
* change: the schema of the record key table
* fix: an INSERT statement
* fix: an insert statement for primary record tables
* feat: add a new option `-default_select_lock_mode`
* channge: insert information when calling read_()
* fix: the method read_
* Implement file locking of indexed files (#678)
* add: processUuid and processId
* add: create a new table `file_lock`
* refactor: suppress PMD warnings
* fix: sql statement creating a new table `file_lock`
* wip: wip
* fix: a PMD warning
* fix: a SpotBug warning
* refactor: remove printStackTrace()
* fix: check formats of indexed files to open
* test: remove unnecessary checks
* fix: change constants to avoid overlaps
* fix: add a file existing check
* test: fix the test of opening an invalid indexed file
* test: fix load.at not to call default error handlers
* chore: end a transaction
* refactor: CobolIndexedFile.java
* test: prevent infinite loops
* refactor: CobolIndexedFile.java
* wip: wip
* fix: improve open_ in CobolIndexedFile.java
* change: set transaction settings
* set the transaction mode to EXCLUSIVE
* set busy_timeout to 5000
* feat: implement file locks of indexed files
* fix: change the condition of creating file_lock
* change: set the transaction isolation to SERIALIZABLE
* test: add tests of file locking of indexed files
* Update libcobj/app/src/main/java/jp/osscons/opensourcecobol/libcobj/file/CobolIndexedFile.java
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Update libcobj/app/src/main/java/jp/osscons/opensourcecobol/libcobj/file/CobolIndexedFile.java
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* refactor: remove unnecessary comments
* refactor: fix typo
* refactor: fix typo
---------
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* refactor: CobolIndexedFile.java
* add: lock a record when READ NEXT is executed
* add: unlock records when closing indexed files
* fix: the process of unlocking a file lock
* fix: controling transactions when rewriting records
* fix: commit timing when writing records
* fix: commits and rollbacks in WRITE, REWRITE and DELETE
* change: -default_lock_mode to -lock-mode-automatic
* refactor: code for commiting data
* add: unlock the previous record after writing
* add: unlock previous records after rewriting
* add: impelment record lockings of DELETE
* fix: constant numbers
change the value of COB_LOCK_AUTOMATIC and COB_LOCK_MULTIPLE
in CobolFile.java
* chore: remove duplicated code
* fix: close ResultSet not to lock database implicitly
* fix: close ResultSet in CobolIndexedFile.java
* add: NewIndexedCursor.java
* wip: read forward
* wip: read prev
* fix: fetchRecord
* fix: READ NEXT/PREVIOUS
* fix: READ
* fix: fetchRecord
* fix: fetchRecord
* fix: START
* fix: START ~ KEY IS GREATER THAN
* fix: START ~ KEY IS <=
* fix: START and READ NEXT RECORD
* refactor: resolve PMD warnings
* chore: migrate NewIndexedCursor to IndexedCursor
* fix: allow READ WITH LOCK/WITH NO LOCK if LOCK MODE IS AUTOMATIC
* fix: call commit() in the end of READ and READ NEXT/PREV
* fix: initialize previousLockedReclordKey in close_()
* test: add some tests for record locking
* fix: unlock Previous records at the end of READ
* test: accelerate file locking tests
* test: wip
* test: add tests for `READ WITH LOCK`
* test: check the final state of an indexed file
* fix: do not read data when the file status is not 00
* test: move common java code for record lock tests
* test: add tests for different records
* test: add tests for input mode
* test: add tests for the same process
* fix: commit at the end of start_
* test: guarantee that OPEN,START,WRITE,REWRITE cannot lock indexed file records
* test: fix tests for OPEN,START,WRITE and REWRITE
* fix: processes of unlocking records
* tests: add tests for unlocking records
* tests: add tests of OPEN INPUT
* test: add tests for LOCK MODE
* test: add tests of -lock-mode-automatic
* tests: move tests for indexed files lock to tests/indexed-lock
* ci: run tests `indexed-lock`
* chore: fix typo
* fix: the syntax error of an sql statement in IndexedCursor.java
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>1 parent 663eb60 commit f984a89
File tree
30 files changed
+5800
-2135
lines changed- .github/workflows
- cobj
- libcobj/app/src/main/java/jp/osscons/opensourcecobol/libcobj/file
- tests
- indexed-lock.src
- module-sync
- run.src
30 files changed
+5800
-2135
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
| 44 | + | |
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
| 57 | + | |
57 | 58 | | |
58 | 59 | | |
59 | 60 | | |
| |||
74 | 75 | | |
75 | 76 | | |
76 | 77 | | |
| 78 | + | |
77 | 79 | | |
78 | 80 | | |
79 | 81 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
| 61 | + | |
61 | 62 | | |
62 | 63 | | |
63 | 64 | | |
| |||
79 | 80 | | |
80 | 81 | | |
81 | 82 | | |
| 83 | + | |
82 | 84 | | |
83 | 85 | | |
84 | 86 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
| 57 | + | |
57 | 58 | | |
58 | 59 | | |
59 | 60 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
145 | 145 | | |
146 | 146 | | |
147 | 147 | | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
148 | 151 | | |
149 | 152 | | |
150 | 153 | | |
151 | 154 | | |
| 155 | + | |
152 | 156 | | |
153 | 157 | | |
154 | 158 | | |
| |||
311 | 315 | | |
312 | 316 | | |
313 | 317 | | |
| 318 | + | |
314 | 319 | | |
315 | 320 | | |
316 | 321 | | |
| |||
901 | 906 | | |
902 | 907 | | |
903 | 908 | | |
| 909 | + | |
| 910 | + | |
904 | 911 | | |
905 | 912 | | |
906 | 913 | | |
| |||
1156 | 1163 | | |
1157 | 1164 | | |
1158 | 1165 | | |
| 1166 | + | |
| 1167 | + | |
| 1168 | + | |
| 1169 | + | |
1159 | 1170 | | |
1160 | 1171 | | |
1161 | 1172 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
383 | 383 | | |
384 | 384 | | |
385 | 385 | | |
| 386 | + | |
386 | 387 | | |
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| |||
515 | 515 | | |
516 | 516 | | |
517 | 517 | | |
518 | | - | |
519 | 518 | | |
520 | 519 | | |
521 | | - | |
522 | 520 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5382 | 5382 | | |
5383 | 5383 | | |
5384 | 5384 | | |
5385 | | - | |
5386 | | - | |
5387 | | - | |
| 5385 | + | |
5388 | 5386 | | |
5389 | 5387 | | |
5390 | 5388 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1725 | 1725 | | |
1726 | 1726 | | |
1727 | 1727 | | |
| 1728 | + | |
1728 | 1729 | | |
1729 | 1730 | | |
1730 | 1731 | | |
| |||
0 commit comments