Unable to persist an object into MySQL database
Description
duplicates
Activity

Former user February 23, 2015 at 6:58 PM
Duplicates HHH-9446.

KamilJ February 21, 2015 at 6:40 AM
I originally used version 4.3.8.Final. I found on stackoverflow someone with a problem that appeared to be the same as mine and his solution was to change the hibernate version to 4.3.5 and then I tried all the versions listed in "Affects Version" field and... I didn't notice that in version 4.3.5 I got my exception only in the browser, but not in actual server logs... it turns out that my browser simply cached the page containing the exception... Sorry for the false alarm. Hope you'll fix the bug in the next version of hibernate.
Thanks for the workaround.

Former user February 20, 2015 at 8:36 PM
I suspect this may be related to HHH-9446.
What version of Hibernate was being used when you got this stacktrace? If it was 4.3.6 or after, can you try running your application with 4.3.5 an posting your stacktrace?
Thanks,
Gail
The project with problems can be cloned from github: https://github.com/kamiljano/quickquiz.git
when application starts, the database schema gets generated correctly and when you call the url http://localhost:8080/quickquiz-web-1.0-SNAPSHOT/rs/quiz/list (loads all elements from table Quiz with getSession().createCriteria(Quiz.class).list()) everything works fine and entities are loaded correctly, hence I'm assuming my hibernate configuration is correct.
The problems however manifests when trying to persist an entity.
Can be easily presented by requesting http://localhost:8080/quickquiz-web-1.0-SNAPSHOT/rs/quiz/createQuiz
(the code in this case literally doesn't do anything but call the getSession().persist(new Quiz))
The line responsible for persisting the entity throws the following exception: