openzim / cms

ZIM file Publishing Platform
https://cms.openzim.org
GNU General Public License v3.0
4 stars 0 forks source link

Transaction not being rolled back #50

Closed rgaudin closed 2 years ago

rgaudin commented 2 years ago

When creating a book using create_book endpoint, should an exception occur in the metadata handling, the function is halted but the Book entry, which is created first, is still present.

The @database.transaction() is thus not doing what we'd expect: rollback every query from that function should an exception be raised.

This happens on online version which is using mariadb upon pymysql.err.IntegrityError: (1062, "Duplicate entry 'Creator-wikipedia_fa_top' for key 'uc_titles_metadata_name_title'")