Hi everyone,
I’m currently doing some hands-on practice as part of my Blue Prism Training and decided to experiment a bit with Hibernate for backend data handling in a sample Java project.
While testing some process automation scenarios, I keep running into a
LazyInitializationException
. It happens when I try to access a related entity after the session is closed, which I understand is expected—but I’m not sure of the best approach to fix it in a real-world scenario.
In this specific use case, I’m simulating a bot fetching customer data via a REST API, which hits a Hibernate-managed entity with lazy loading. I’ve read about DTO mapping and JOIN FETCH
, but I’m unsure what’s best in a clean architecture setup.
Can someone point me in the right direction or share how they’d handle this in a production-grade project?
Really appreciate any help or shared experience!
Thanks,
HJ Bishop