I change my connection to tomcat datasource in my springboot app, but after I change my app start to get the lazy load erro:
org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: br.com.lumera.cartoriointeligente.backend.entity.TbMovimentacao.pedidos, could not initialize proxy - no Session
at org.hibernate.collection.internal.AbstractPersistentCollection.throwLazyInitializationException(AbstractPersistentCollection.java:587) ~[hibernate-core-5.0.11.Final.jar:5.0.11.Final]
at org.hibernate.collection.internal.AbstractPersistentCollection.withTemporarySessionIfNeeded(AbstractPersistentCollection.java:204) ~[hibernate-core-5.0.11.Final.jar:5.0.11.Final]
at org.hibernate.collection.internal.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:566) ~[hibernate-core-5.0.11.Final.jar:5.0.11.Final]
When I develop I don`t get this error because I use the default connection from springboot, but in Prod when I use datasource fail..
anyone know how fix this?
tks