I was wondering how to handle this anomaly:
- DTO must be converted to a controller, the level of service should not know about them.
- Transaction boundaries are determined by the level of service.
But how do you avoid the JPA LazyInitialization exception? Daz transformation may require Lazy Fetched data, but it cannot, because the transaction is being processed by the service level.
There are ways that I can think of, but they are all ugly. Putting a DTO into a service layer seems to me the best for me right now.
source
share