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

Weird behaviour in PostgreSQL database #3235

Closed
g-mos opened this issue Sep 26, 2017 · 6 comments
Closed

Weird behaviour in PostgreSQL database #3235

g-mos opened this issue Sep 26, 2017 · 6 comments

Comments

@g-mos
Copy link

g-mos commented Sep 26, 2017

JabRef version JabRef-4.0-dev--snapshot--2017-09-20--master--b0489d5b3 on Windows 10 | Ubuntu 16.04

Steps to reproduce:

  1. Connect to a shared database
  2. Tick automatically save the library to
  3. Connect

On a database viewer I was monitoring what was done on the database.
The weird thing I saw was, that when Jabref started to connect all the metadata table was deleted. The first thing restored was the databaseType key. Then gradually the program restored back all the information. This is independent if the file I save to, exists or is a new one. This does not happen to the ENTRY and FIELD tables. It happens both in WIndows and Ubuntu 16.04.
Since db connection is slow at initializing, if it crashes in the middle metadata information can be lost (I have lost the group information once but I cannot repeat that). Maybe this is what had happened.

@lenhard
Copy link
Member

lenhard commented Sep 27, 2017

To add a link to the issue you were referring to #2647

@g-mos
Copy link
Author

g-mos commented Oct 10, 2017

Some more info I can provide. I do not know what the logic inside Jabref is but database oriented from what I understood:

  1. There is an ENTRY table for which per entry it tells what type of entry it is and its version type.
  2. There is a FIELD table with multiple inputs per entry with the different fields and the data per field.
  3. There is a METADATA table with all the "Unconventional" Information, like the database type, the group structure, the save-actions and the personalized file directory.

I was playing with Wireshark, a program registering all the packages to and forth the database and I saw the following, after the initialisation:
SELECT * FROM "METADATA"
TRUNCATE TABLE "METADATA"
INSERT INTO "METADATA"("KEY", "VALUE") VALUES($1, $2)
The first is absolutely logical but the second and third statements are puzzling me in 2 different ways.

First as I already mentioned the metadata table sometimes gets completely lost. I can say that it has a 10% probability to get lost per opening the program. I am opening and reopening a lot and I can say I restore the metadata table from a backup often.

Secondly the database setup is to be used in a group environment. I have it now only with three colleagues where we are experimenting (desktops, laptops etc) resulting in a 12 line table. If I go mainstream in the group I expect at least 20 more lines. Why should Jabref rewrite them every time?

I hope I helped a little bit in the problem.

@lenhard
Copy link
Member

lenhard commented Oct 10, 2017

@g-mos: @tobiasdiez has implemented a fix for this problem. Could you please check out the version available at http://builds.jabref.org/fix3235/ and see if that solves your issue? Meta data should now be updated instead of deleted and re-inserted.

@g-mos
Copy link
Author

g-mos commented Oct 10, 2017

I have already downloaded this version and I am testdriving it. I will reply tomorrow for sure but until now it seems ok.

@g-mos
Copy link
Author

g-mos commented Oct 10, 2017

Update: Wireshark confirmed that the data are updated and not deleted. Furthermore 4/5 restarts didn't cause a problem yet. As a general question some other weird things that I am seeing in wireshark, irrelevant to this bug where should I discuss them, eg (double login on the db, SELECT * FROM "ENTRY" WHERE "SHARED_ID" = 1 ORDER BY "SHARED_ID" )

@g-mos
Copy link
Author

g-mos commented Oct 12, 2017

After 3 days of working, deleting of the metadata did not happen again, so I can consider the problem fixed and this bug closed.

lenhard pushed a commit that referenced this issue Oct 13, 2017
* Fix #3235: remote metadata is updated instead of delete + insert

* Fix spaces

* Fix spaces part 2

* Update CHANGELOG.md
Siedlerchr added a commit that referenced this issue Oct 19, 2017
* upstream/master:
  Update gradle to 4.2.1 (#3322)
  Avoid recreation of the EntryEditor (#3187)
  Fix #3133 telemetry by locking azure to 1.0.9
  German translation for missing properties (#3312)
  Improvement for Java FX font rendering on Linux (#3305)
  Add also conversion for em dash
  Add \textendash to the html conversion table
  Update latex2tunicode from 0.2.1 -> 0.2.2
  Added note about updating controlsfx
  Fix exception/freezing on EntryChangedEvent in Entry Editor (#3299)
  Update libs (#3300)
  update guava from 23.0 -> 23.2
  update mvvmfx-validation from 1.6.0 -> 1.7.0
  Resolves #3255 file open dialog should have "supported formates" filetype
  Fix #3235: remote metadata is updated instead of delete + insert (#3282)
  Change OO paths to Libre Office in preferences (#3287)
  Fix #2471: remove line breaks from abstracts in ADS fetcher (#3285)
  Resolves #3280 Empty String instead of N/A (#3288)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants