Spring boot 使用tomcat数据源延迟加载的Springboot

Spring boot 使用tomcat数据源延迟加载的Springboot,spring-boot,datasource,Spring Boot,Datasource,我在springboot应用程序中更改了与tomcat数据源的连接,但在更改应用程序后,开始获取延迟加载错误: org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: br.com.lumera.cartoriointeligente.backend.entity.TbMovimentacao.pedidos, could not initialize proxy -

我在springboot应用程序中更改了与tomcat数据源的连接,但在更改应用程序后,开始获取延迟加载错误:

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]
当我开发时,我没有得到这个错误,因为我使用了springboot的默认连接,但是在Prod中,当我使用datasource时失败了

有人知道怎么解决这个问题吗


tks

可能重复…不重复,当我使用正常连接时工作正常。但使用datasource时,情况并非如此。我想这是另一种配置,你能粘贴
tbmovinmentacao
实体类吗?在我的tbmovinmentacao中,我有一个带有LAZY的配置,但我的疑问是,为什么当我使用Springboot jpa时,我没有这个问题,而使用tomcat数据源时,我有这个问题