I have the following problem, when trying to insert an object in the database Hibernate gets stuck, no error returned, the object is not saved correctly.
Debugging it I found out that it hangs at
Hibernate: select nextval('hibernate_sequence')
I am using PostgreSQL as a database.
My configuration file:
<hibernate-mapping>
<class name="src.MyClass" table="MyClass">
<cache usage="read-write"/>
<id name="id" column="classid">
<generator class="native" />
</id>
<property name="name" column="name" not-null="true" unique="true" length="160"/>
</class>
</hibernate-mapping>
@Override
public void save( Myclass mc)
{
Session session = sessionFactory.getCurrentSession();
session.save( mc);
}
The SELECT part works.
I'm not sure what I'm missing. Also using native SQL Insert command, it works.