Skip to content
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

[WIP] Initial work on DBMSProcessor batch entry insertion into ENTRY table #5814

Merged
merged 31 commits into from
Feb 19, 2020
Merged
Changes from 1 commit
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
e701c62
Initial work on DBMSProcessor entry insertion into ENTRY table
abepolk Jan 2, 2020
a5bfc87
Change syntax for Oracle multi-row insert SQL statement
abepolk Jan 17, 2020
3027c54
Merge branch 'master' into batch_DBMSProcessor_entries
abepolk Jan 17, 2020
ae9d53c
Run tests also when source files changed
tobiasdiez Jan 17, 2020
ed675a2
Add to comment about Oracle
abepolk Jan 21, 2020
4e80030
Assume ResultSet is in order for setting shared IDs
abepolk Jan 22, 2020
67fdf27
Add insertEntry for DBMSProcessor tests and fix PostgresSQLProcessor
abepolk Jan 22, 2020
8aaf774
Fix SQL typo
abepolk Jan 25, 2020
bbc81ab
Separate table drops in Oracle tests
abepolk Jan 27, 2020
74ab816
Merge remote-tracking branch 'fork/fix_fields_sql' into fix_fields_sql
abepolk Jan 27, 2020
17de560
Remove CI tests that were added in branch
abepolk Jan 27, 2020
5f23e03
Work on unit test for DBMSProcessor insertEntries
abepolk Jan 30, 2020
402a9cc
Fix bug in DBMSProcessorTest and simplify DBMSProcessor.FilterForBibE…
abepolk Jan 31, 2020
a37129a
Remove Oracle connection bug with wrong port
abepolk Jan 31, 2020
94a75cd
Add Oracle insertIntoEntryTable
abepolk Jan 31, 2020
fbf1d33
Oracle connection fix - taken from fix_fields_sql branch
abepolk Jan 31, 2020
dbbfe00
Fix typo bug
abepolk Jan 31, 2020
a5ab4e5
Clean up code
abepolk Jan 31, 2020
2279464
Remove commented blocks
abepolk Jan 31, 2020
926473a
Remove comment about needing a test that probably isn't necessary
abepolk Jan 31, 2020
9d5960f
Manually merge fix_fields_sql OracleProcessor (just add method)
abepolk Jan 31, 2020
a2fcb77
Merge fix_fields_sql
abepolk Jan 31, 2020
3bdf2d8
Emphasize todo
abepolk Jan 31, 2020
85f9196
setSharedID into OracleProcessor entry table method
abepolk Feb 1, 2020
245c48e
Add shared id to preparedEntryStatement
abepolk Feb 2, 2020
79d8354
Make Oracle insertIntoEntryTable iterative - pasted from master - not…
abepolk Feb 19, 2020
c315838
Add fields to fields table in parallel
abepolk Feb 19, 2020
c073b8f
Merge master
abepolk Feb 19, 2020
934acb2
Reset test trace length
abepolk Feb 19, 2020
bd32ecd
Fix checkStyle
abepolk Feb 19, 2020
99191ff
Revert port setting
tobiasdiez Feb 19, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/main/java/org/jabref/logic/shared/OracleProcessor.java
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,8 @@ protected void insertIntoEntryTable(List<BibEntry> entries) {
}
insertEntryQuery.append(" SELECT * FROM DUAL");
LOGGER.info(insertEntryQuery.toString());
try (PreparedStatement preparedEntryStatement = connection.prepareStatement(insertEntryQuery.toString())) {
try (PreparedStatement preparedEntryStatement = connection.prepareStatement(insertEntryQuery.toString(),
new String[]{"SHARED_ID"})) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure, but this looks odd to me with the String[]

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This just indicates the column where we want to put the auto-generated keys. See https://docs.oracle.com/javase/7/docs/api/java/sql/Connection.html#prepareStatement(java.lang.String,%20int[])

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I looked into Stack Overflow and the Oracle JDBC driver source code and it looks like the Oracle JDBC doesn't support getGeneratedKeys on INSERT ALL statements. So I'll have to find another way of getting the shared IDs.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OMG. This sounds like we should really drop Oracle support. There is no need for Oracle in 2020, is it? - Postgres is the way to go, isn't it?

We should IMHO also drop MySQL support as it does not offer automatic updates on changes on the server.

for (int i = 0; i < entries.size(); i++) {
// columnIndex starts with 1
preparedEntryStatement.setString(i + 1, entries.get(i).getType().getName());
Expand Down