Category Archives: Hibernate

Hibernate Query Cache

      1 Comment on Hibernate Query Cache

Hibernate provides sophisticated caching mechanisms to improve the performance. Apart from First-level, Second-Level and query cache, Hibernate can be configured to make use of some open source cache solutions like EHCache or JBoss Cache etc. If your Hibernate query yields huge but similar results every time it is executed, it… Read more »

SQLGrammarException could not fetch initial value for increment generator

In the earlier versions of Hibernate, may be hibernate 2.x, if you use increment generator on a new table then you might get this error. If you really need to use the increment generator on the new table then you need to create a dummy row on that table. This… Read more »

HibernateSystemException- Don’t change the reference to a collection with cascade=”all-delete-orphan”

This is not an error which I got. This is an error that bugged one of my friend for a few days. The error is org.springframework.orm.hibernate3.HibernateSystemException: Don’t change the reference to a collection with cascade=”all-delete-orphan”: com.test.Cat.kittens; nested exception is org.hibernate.HibernateException: Don’t change the reference to a collection with cascade=”all-delete-orphan”: com.test.Cat.kittens… Read more »

Hibernate error : org.hibernate.hql.ast.QuerySyntaxException: unexpected end of subtree

Update: Look at the comments for more information and possible solutions. I got this error today. While there could be many reasons because of which this error comes. For me, the problem was that the parameter list I was passing was empty. I was getting all the fruits for which… Read more »

org.hibernate.TransientObjectException Revisited

This is continuation of my earlier post on org.hibernate.TransientObjectException. Let me write the scenario again <class name=”com.xxx.A” table=”A” schema=”TESTSCHEMA”> <id name=”aId” type=”java.lang.Long”> <column name=”A_ID” precision=”29″ scale=”0″ /> </id> ………………….. some more mapping elements ………………….. ………………….. <many-to-one name=”bId” class=”com.xxx.B” fetch=”select”> <column name=”B_ID” precision=”29″ scale=”0″ /> </many-to-one> ………………….. A is referring to… Read more »

MyEclipse Hibernate Spring tutorial – Managing Hibernate transaction in Spring

Spring transaction management, Hibernate transaction management in Spring There was a problem/defect in the MyEclipse tutorial on Hibernate Spring. It was not a major problem. The tutorial demonstrates the Spring and Hibernate functionality pretty well. The only problem was that the code does seems to work properly. Because of absence… Read more »

org.hibernate.TransientObjectException: object references an unsaved transient instance – save the transient instance before flushing:

I was getting this error today. org.hibernate.TransientObjectException: object references an unsaved transient instance – save the transient instance before flushing:This is the problemTable A was referring to the talbe B using a foreign key hbm.xml for A looked like this <class name=”com.xxx.A” table=”A” schema=”TESTSCHEMA”> <id name=”aId” type=”java.lang.Long”> <column name=”A_ID” precision=”29″… Read more »

ORA-01747: invalid user.table.column, table.column, or column specification

Today I got this error. ORA-01747: invalid user.table.column, table.column, or column specification. There could be many reasons why you can get this error. But the basic reason is the query which is finally getting executed to your database is wrong in some way. In my case, I had a column… Read more »