rb-sl / DB2_project

Databases 2 project - Politecnico di Milano
0 stars 1 forks source link

Created state of inconsistency in DB for user Gregor #25

Closed ericaceriotti closed 3 years ago

ericaceriotti commented 3 years ago

After deleting access for user gregor, re-answering questions, then deleting and recreting same questionnaire and answering again has created a state of inconsinstency so that now if I try to answer a single question on a one-question questionnaire, for example green rubber duck this happens: [EL Fine]: 2021-06-20 16:01:57.405--ServerSession(1791330585)--Connection(1347406202)--Thread(Thread[http-nio-8080-exec-5,5,main])--SELECT word_id, word FROM badwords [EL Fine]: 2021-06-20 16:01:57.427--ServerSession(1791330585)--Connection(1326617295)--Thread(Thread[http-nio-8080-exec-5,5,main])--SELECT quest_id, date, product_fk FROM questionnaire WHERE (date = ?) bind => [2021-06-20] [EL Fine]: 2021-06-20 16:01:57.449--ClientSession(1850619162)--Connection(1006453855)--Thread(Thread[http-nio-8080-exec-5,5,main])--INSERT INTO access (accessDate, accessTime, age, expertise, sex, quest_fk, user_fk) VALUES (?, ?, ?, ?, ?, ?, ?) bind => [2021-06-20, 16:01:57.448733100, 0, Unknown, U, 35, 7] [EL Fine]: 2021-06-20 16:01:57.515--ClientSession(1850619162)--Connection(1006453855)--Thread(Thread[http-nio-8080-exec-5,5,main])--SELECT LAST_INSERT_ID() [EL Fine]: 2021-06-20 16:01:57.536--ClientSession(1850619162)--Connection(1006453855)--Thread(Thread[http-nio-8080-exec-5,5,main])--INSERT INTO answer (access_fk, text, question_fk) VALUES (?, ?, ?) bind => [43, no, 1] [EL Fine]: 2021-06-20 16:01:57.672--ClientSession(1850619162)--Connection(1006453855)--Thread(Thread[http-nio-8080-exec-5,5,main])--INSERT INTO answer (access_fk, text, question_fk) VALUES (?, ?, ?) bind => [43, yess, 13]

Two answers are inserted for user gregor even if there is only one access.