I ran into a problem last week hibernate native set a null ID exception from growth, the original post address http://topic.csdn.net/u/20110406/09/ 1a27c751-d817-4cdb-a7fd-0fda09582309.html,
The exception information is org.springframework.dao.InvalidDataAccessResourceUsageException:could not insert:caused by: Org.hibernate.exception.DataException:could not insert:caused by:com.ibm.db2.jcc.a.wm:db2 SQL error:sqlcode=-302, SQ lstate=22001, Sqlerrmc=null, driver=3.51.90 org.hibernate.AssertionFailure:null ID in entry (don ' t flush the session AFTE R A exception occurs) Java.lang.reflect.InvocationTargetException caused By:org.hibernate.AssertionFailure:null ID in Entry (don ' t flush after a exception occurs)
Last I thought is the primary key generation is empty, but tried native and identity are not good, then the test found that because there is a long degree of insufficient, but Hibernate reported this message is not convenient location, I set the database field length after the problem is resolved.