-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Implementation of shared database support #1451
Conversation
Issue: #970 |
e79c5ff
to
add5fb3
Compare
@@ -483,6 +483,7 @@ public void actionPerformed(ActionEvent e) { | |||
private final List<Object> openDatabaseOnlyActions = new LinkedList<>(); | |||
private final List<Object> severalDatabasesOnlyActions = new LinkedList<>(); | |||
private final List<Object> openAndSavedDatabasesOnlyActions = new LinkedList<>(); | |||
private final List<Object> remoteDatabasesOnlyActions = new LinkedList<>(); |
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.
Could you please investigate if its possible to use a more concrete typ here and above then object?
Using Object in a generic type is making the whole concept of generics ad absurdum.
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.
Those lists are used to add actions. Unfortunately there are differnt types of them, such as AbstractAction
, GeneralActions
which extends MnemonicAwareAction
or just the interface Action
.
I think this could be a good stuff for a new PR.
Looks good overall, just some minor remarks 👍 Please also add some new Database tests. |
Why do you want to include Oracle? What is the reasoning here? Is this a DB that is likely to be used in this context? I am not really sure as Oracle is expensive and hard to maintain. I am against changing the events and adding a location to them. Why must this be differentiated in the first place? All the metadata must be stored in the DB as well, including biblatex or bibtex mode (this is not something the user should change). Also do not forget the save actions, as they have an influence on the values in the DB as well. What happens if a change locally cannot be stored in the DB as there are conflicts? |
Me really wants Oracle. Some bigger institutes use Oracle and they don't want to run other databases. At least, this is, what I understood. I will contact them again and ask how important Oracle is. Currently, it seems that the hard part of the Oracle implementation is already done. The synchronization via events seems to be easy - see implementation hints at #970. |
Ok, then please remove the lib file and use a file from maven repositories for the ojdbc.jar |
Okay, this is going to be implemented.
Unfortunately I didn' t understand that completely. Now if you work on remote database you've still the possibility to save the file locally. Otherwise the changes are pushed by EntryEvents. Are there some other data which are involved within the saving process?
In this mode the newest version is held by remote database. Changes are going to be pushed automatically and every time you push an entry your local database is also going to be updated (this process is going to be accelerated via hashing etc). So there is no scenario a conflict can occur except connection problems. But in this case the editor should restrict any editings (TODO). Or two people are working at the same time at one field. In this case the last push will win. |
add5fb3
to
e7dcebc
Compare
The save actions control stuff like that a specific field must be lower or upper case letters. Think about it: person A always uses lower case letters for the title, and person B uses always upper case letters for the title - what effect will this have on the database sync when basically the same data is used? They will create a lot of traffic if they work concurrently as the save of one will overwrite all the title fields of the other, and it will create conflicts. You can only overcome this if both know the correct save actions, and that is the reason why the save actions are stored in the metadata. Regarding resolving conflicts: sounds ok to be practical. It feels wrong, however, from my background with using version control systems. |
d47d740
to
ee64d6a
Compare
I think it would be very profitable to unite the code for file-based exports with the code for sql-exports. For example, I really like the |
Currently I'm working on save actions. As I see the remote synchronization differs a lot from the local saving of metadata and defaults (think about the relational structure). Unifiying the code would dissolve the Currently I'm going to implement this in |
e092e5c
to
bc26166
Compare
@simonharrer @koppor It seems that ojdbc.jar is not longer available in maven repositories.
|
.append(" WHERE ") | ||
.append(escape("SHARED_ID")) | ||
.append(" = ") | ||
.append(sharedID); |
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.
Always use prepared statement, please.
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.
Done.
f60328c
to
c17631b
Compare
return Optional.ofNullable(dbmsType); | ||
} | ||
try { | ||
return Optional.of(Enum.valueOf(DBMSType.class, typeName.toUpperCase())); |
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.
Good! But I recommend adding Locale.ENGLISH in the toUpperCase method.
Here is a nice explanation why it is sometimes necessary (the infamous Turkish Locale bug)
http://mattryall.net/blog/2009/02/the-infamous-turkish-locale-bug
Conflict resolution with Optimistic Offline Lock 👍 After resolving the minor issues from above, I vote for merging to prevent the continuous merging conflicts. Follow up at #1703 |
e201f7f
to
bb37704
Compare
bb37704
to
891387e
Compare
Support for MySQL, PostgreSQL and Oracle database systems. Full entry synchronisation. Full meta data synchronization. Group synchrnoization. Semi-automatic/event based synchronization. Version control system. Conflicts resolving machanisms. User interfaces for different situations. Extensive synchronization and class tests.
891387e
to
72d929f
Compare
* master: (22 commits) Do not cite entries without a key in OpenOffice/LibreOffice (JabRef#1682) (JabRef#1683) Got rid of unused preferences (JabRef#1672) Move labelpattern (JabRef#1626) Implementation of shared database support (full system). (JabRef#1451) Removed bst from architecture tests JabRef#1699 Update PULL_REQUEST_TEMPLATE.md French localization: Menu: Translation of an empty string French localization: Jabref_fr: empty strings translated Updated string similarity version (JabRef#1698) Minify description of release process Announce switch from GPL to MIT in CONTRIBUTING.md and README.md Some cleanups to initialize empty MetaData at fewer positions (JabRef#1696) Automatic group names are converted from LaTeX to Unicode (JabRef#1684) Update ISSUE_TEMPLATE.md (JabRef#1686) Removed (false) NPE issue reported by FindBugs More Swedish translations (JabRef#1691) Updated wiremock version (JabRef#1690) Some minor code cleanups (JabRef#1689) Removed dependencies of Globals.prefs in some tests (JabRef#1688) Lookup BibEntry from ISBN and merge information (JabRef#1621) ... # Conflicts: # src/main/java/net/sf/jabref/gui/BasePanel.java # src/main/java/net/sf/jabref/importer/ImportMenuItem.java # src/main/resources/l10n/JabRef_da.properties # src/main/resources/l10n/JabRef_de.properties # src/main/resources/l10n/JabRef_en.properties # src/main/resources/l10n/JabRef_es.properties # src/main/resources/l10n/JabRef_fa.properties # src/main/resources/l10n/JabRef_fr.properties # src/main/resources/l10n/JabRef_in.properties # src/main/resources/l10n/JabRef_it.properties # src/main/resources/l10n/JabRef_ja.properties # src/main/resources/l10n/JabRef_nl.properties # src/main/resources/l10n/JabRef_no.properties # src/main/resources/l10n/JabRef_pt_BR.properties # src/main/resources/l10n/JabRef_ru.properties # src/main/resources/l10n/JabRef_sv.properties # src/main/resources/l10n/JabRef_tr.properties # src/main/resources/l10n/JabRef_vi.properties # src/main/resources/l10n/JabRef_zh.properties
Support for MySQL, PostgreSQL and Oracle database systems. Full entry synchronisation. Full meta data synchronization. Group synchrnoization. Semi-automatic/event based synchronization. Version control system. Conflicts resolving machanisms. User interfaces for different situations. Extensive synchronization and class tests.
@obraliar Could you please answer http://discourse.jabref.org/t/new-sql-structure/197/4 ? Thanks! |
Implementation of shared database support for MySQL, PostgreSQL and Oracle database systems.
Made changes:
sql
package removed. (This request aims to replace the old system completely)(manual and semi-automated pull)
Screenshots: