I need to do some processing on an Entity. I'd like it to be outside a transaction. The thing is this entity contains some lazy-loaded fields so that my program fails on accessing some of them because of not having a session active.
The most natural thing to do would be to fully initialize such entity once it's loaded but still in transactional scope (before detaching it). But I can't find how to do that. Is there really no simple method do such a trivial thing? I'd like to stay behind JPA spec.
For some reason fetch all properties in jpql does not work.