You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* 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
* 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 <175728472+Copilot@users.noreply.github.com>
* chore: simplify some `if` conditions
---------
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy file name to clipboardExpand all lines: libcobj/app/src/main/java/jp/osscons/opensourcecobol/libcobj/user_util/indexed_file/IndexedFileUtilMain.java
+96Lines changed: 96 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -137,6 +137,40 @@ public static void main(String[] args) {
137
137
System.err.println("error: " + e.getMessage());
138
138
System.exit(1);
139
139
}
140
+
} elseif ("migrate".equals(subCommand)) {
141
+
if (unrecognizedArgs.length != 2) {
142
+
if (unrecognizedArgs.length < 2) {
143
+
System.err.println("error: no indexed file is specified.");
144
+
} else {
145
+
System.err.println("error: too many indexed files are specified.");
146
+
}
147
+
System.exit(1);
148
+
}
149
+
StringindexedFilePath = unrecognizedArgs[1];
150
+
try {
151
+
migrateIndexedFile(indexedFilePath);
152
+
} catch (Exceptione) {
153
+
System.err.println("error: " + e.getMessage());
154
+
System.exit(1);
155
+
}
156
+
System.exit(0);
157
+
} elseif ("unlock".equals(subCommand)) {
158
+
if (unrecognizedArgs.length != 2) {
159
+
if (unrecognizedArgs.length < 2) {
160
+
System.err.println("error: no indexed file is specified.");
161
+
} else {
162
+
System.err.println("error: too many indexed files are specified.");
163
+
}
164
+
System.exit(1);
165
+
}
166
+
StringindexedFilePath = unrecognizedArgs[1];
167
+
try {
168
+
unlockIndexedFile(indexedFilePath);
169
+
} catch (Exceptione) {
170
+
System.err.println("error: " + e.getMessage());
171
+
System.exit(1);
172
+
}
173
+
System.exit(0);
140
174
} elseif ("load".equals(subCommand)) {
141
175
if (unrecognizedArgs.length < 2 || unrecognizedArgs.length > 3) {
0 commit comments