Hello Jones and thank you for reporting the issue. The cause of the error you’re encountering is the same as we discussed in https://hibernate.atlassian.net/browse/HHH-16254: the getEntity() method in your pre-load event is returning a proxy}}ed entity (needed for handling caching+batching associations). This, in turn, causes the {{Hibernate.getClass() method to trigger an initialization of the proxy, that leads to the pre-load event being called again with the same proxy, causing an infinite recursion loop. We’re exploring the possibility of not using a proxy in this particular case, but since it’s always possible to obtain one in a pre-load event I’d strongly suggest handling this case correctly. You could, for example, avoid forcing initialization by checking Hibernate.isInitialized( event.getEntity() ) first. |