Archive

Posts Tagged ‘query’

java.lang.StackOverflowError and Hibernate

30 December 2010 Leave a comment

If you have set up your relationships correctly in your @Entity bean but you are still getting this error, I have found out that by explicitly setting the Query‘s flush mode type to COMMIT you can avoid recursive calls that result in a StackOverflowError

query.setFlushMode(FlushModeType.COMMIT);	// Avoid recursive call and StackOverflowError
Categories: Hibernate Tags: , ,