Unable to persist an object into MySQL database

Description

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:

Environment

Apache Maven 3.2.1
Java version: 1.7.0_67, vendor: Oracle Corporation
Default locale: en_US, platform encoding: Cp1252
OS name: "windows 7", version: "6.1", arch: "amd64", family: "windows"

database: MySQL 5
glassfish 4.1.01

Activity

Show:
Gail Badner
February 20, 2015, 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

KamilJ
February 21, 2015, 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.

Gail Badner
February 23, 2015, 6:58 PM

Duplicates HHH-9446.

Assignee

Gail Badner

Reporter

KamilJ

Fix versions

None

Labels

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

Priority

Major
Configure