BernhardWebstudio / DataShot_DesktopApp

Desktop application client intended to support an object-precapture-image-data workflow for capture of natural science collections data. See the wiki (https://github.com/MCZbase/DataShot_DesktopApp/wiki) for user documentation, or the README below for developer documentation.
0 stars 0 forks source link

Deleting List Entries #24

Closed zwickerr closed 4 years ago

zwickerr commented 4 years ago

After a specimen has been saved, when an entry in the lists ("Determinations", "Collectors", "Specimen Parts", "Numbers") has been deleted, the specimen cannot be saved again. When trying to save the following error is shown: Error. Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1; statement executed: com.mysql.cj.jdbc.ClientPreparedStatement: delete from Specimen_Part where SpecimenPartId=192520

If the specimen is opened again after a new search, the deleted entry is gone while all other changes to the specimen are lost.

If an entry is deleted before the specimen has been saved for the first time, no error occurs.

zwickerr commented 4 years ago

The issue is not fixed yet.

When saving after deleting an entry in Determinations, Collectors, or Specimen Parts the following error is shown: Error. null

Numbers can not be entered at all anymore. New fields can be added to the list but nothing can be entered. When deleting a row the following error message is shown: Error. Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1; statement executed: com.mysql.cj.jdbc.ClientPreparedStatement: delete from OTHER_NUMBERS where NumberId=32490

GenieTim commented 4 years ago

Thanks for already reaching back; I know that the problem is related to a foreign key in the database, which leads to auto-deletion of the Number/..., whereas the ORM, Hibernate, is not expecting it to be deleted already.

Sorry for spending this weeks hours on preprocessing instead of fixing this, I hope you have no troubles using an elder version of DataShot for those tasks instead.

zwickerr commented 4 years ago

Thanks for the reply. Yes, we can work around the issue with no problem.

GenieTim commented 4 years ago

According to #27, if I understand correctly (and test correctly myself), this is fixed, right?