Hi,
I'll start by saying that I'm not an expert on this subject. Nonetheless, I believe that what's causing the exception is that you're calling the get method on a transaction that ends before the retrieved entitity object reaches the presentation layer. Therefore, if that object does not have all its data, I believe it is impossible for Hibernate to go back and get the remaining data, since the original transaction has already ended.
If you really need to pull that information out of the database, call the getXXX method that retrieves the entity's children objects just before ending the transaction, that is, returning from the method that is marked as transactional.
Kind regards, Nuno Guerreiro
|