Springboot与tomcat数据源延迟加载

时间:2017-05-21 13:38:12

标签: 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 - 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中...

谁知道怎么解决这个问题?

TKS

0 个答案:

没有答案