Home > Hibernate > java.lang.StackOverflowError and Hibernate

java.lang.StackOverflowError and Hibernate

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
Advertisements
Categories: Hibernate Tags: , ,
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: