datacite / mds

The DataCite Metadata Store (MDS)
https://mds.datacite.org
Apache License 2.0
25 stars 16 forks source link

missing rollback on db exception #298

Closed koelnconcert closed 6 years ago

koelnconcert commented 9 years ago

Looks like If a db exception is thrown on POST /metadata, the created dataset record is still persisted.

Log file excerpt:

DEBUG org.datacite.mds.web.api.controller.MetadataApiController - *****POST metadata (doi=***, testMode=false)
[...]
DEBUG org.datacite.mds.domain.Dataset - persist(): SYMBOL:**DOI** (id=****)
[...]
DEBUG org.datacite.mds.web.api.ApiResponseWrapper - sendError 500: uncaught exception (org.hibernate.exception.GenericJDBCException: could not insert: [org.datacite.mds.domain.Metadata]; nested exception is javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: could not insert: [org.datacite.mds.domain.Metadata])

no metadata object, but the dataset record remains existing