However, the above implementation throws an exception when I'm trying to retrieve the Task properties outside the session bean. I know the reason is, that once the detached Task bean is outside the persistence context, it can't be loaded from the database, and since it is was not used in the session bean, it does not get filled at all. However, I need to be able to display all tasks a user has. How am I supposed to do that, without setting the FetchType to Eager, and possibly without using DTOs to transfer objects in and out of the session beans.
P.S.: Sorry for the two posts, I hitted submit instead of preview and was not able to edit my post.
You have just have to call property.size() (of your collection) in your session bean before returning it to other layer.