Commit f2d31fd
* 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 <[email protected]>
* Update libcobj/app/src/main/java/jp/osscons/opensourcecobol/libcobj/file/CobolIndexedFile.java
Co-authored-by: Copilot <[email protected]>
* refactor: remove unnecessary comments
* refactor: fix typo
* refactor: fix typo
---------
Co-authored-by: Copilot <[email protected]>
* 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
* feat: add `cobj-idx migrate`
* feat: add `cobj-idx unlock`
* test: add a test for `cobj-idx migrate`
* test: add a test for `cobj-idx unlock`
* Apply suggestions from code review
Co-authored-by: Copilot <[email protected]>
* chore: simplify some `if` conditions
---------
Co-authored-by: Copilot <[email protected]>
1 parent dbcfae7 commit f2d31fd
File tree
7 files changed
+351
-1
lines changed- libcobj/app/src/main/java/jp/osscons/opensourcecobol/libcobj/user_util/indexed_file
- tests
- cobj-idx.src
- test-data
7 files changed
+351
-1
lines changedLines changed: 96 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
137 | 137 | | |
138 | 138 | | |
139 | 139 | | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
140 | 174 | | |
141 | 175 | | |
142 | 176 | | |
| |||
226 | 260 | | |
227 | 261 | | |
228 | 262 | | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
229 | 271 | | |
230 | 272 | | |
231 | 273 | | |
| |||
413 | 455 | | |
414 | 456 | | |
415 | 457 | | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
416 | 512 | | |
417 | 513 | | |
418 | 514 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
204 | 204 | | |
205 | 205 | | |
206 | 206 | | |
| 207 | + | |
| 208 | + | |
207 | 209 | | |
208 | 210 | | |
209 | 211 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
743 | 743 | | |
744 | 744 | | |
745 | 745 | | |
| 746 | + | |
| 747 | + | |
746 | 748 | | |
747 | 749 | | |
748 | 750 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
| 9 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
Binary file not shown.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
0 commit comments