Skip to content
This repository has been archived by the owner on Dec 19, 2023. It is now read-only.

graphql-java-servlet 11.1.1 with Jpa FetchType.LAZY throw:no Session! but graphql-java-servlet 11.1.0 is OK #778

Closed
heerzhang opened this issue Jun 27, 2021 · 1 comment
Milestone

Comments

@heerzhang
Copy link

I use 'graphql-spring-boot-starter' 11.1.0 version; it include graphql-java-servlet 11.1.1 version; And Jpa use @manytoone(fetch= FetchType.LAZY) ; However, graphql-java-servlet switching to version 11.1.0 is OK!!
on graphql-java-servlet 11.1.1 Run error is:

n.g.e.SimpleDataFetcherExceptionHandler : Exception while fetching data (/getReportOfISP[0]/isp/task/liabler) : could not initialize proxy [md.specialEqp.inspect.Task#122] - no Session
org.hibernate.LazyInitializationException: could not initialize proxy [md.specialEqp.inspect.Task#122] - no Session
at org.hibernate.proxy.AbstractLazyInitializer.initialize(AbstractLazyInitializer.java:170) ~[hibernate-core-5.4.32.Final.jar:5.4.32.Final]
at graphql.kickstart.servlet.HttpRequestInvokerImpl.invoke(HttpRequestInvokerImpl.java:159) ~[graphql-java-servlet-11.1.1.jar:na]
at graphql.kickstart.servlet.HttpRequestInvokerImpl.lambda$invokeAndHandleAsync$2(HttpRequestInvokerImpl.java:77) ~[graphql-java-servlet-11.1.1.jar:na]

application.yml file setting: spring. jpa. open-in-view: true

mention in passing; Jpa use @manytoone(fetch= FetchType.EAGER) with graphql-java-servlet 11.1.1 version also Run OK;

@oliemansm
Copy link
Member

@heerzhang This is cause by a bugfix where the async timeout was not enforced graphql-java-kickstart/graphql-java-servlet#342. Unfortunately that resulted in some unexpected behavior. Will revert the default setting in v12.0.0 so by default async will not be enabled, which is more in line with how this library has worked in the past and with expectation of its users.

@oliemansm oliemansm transferred this issue from graphql-java-kickstart/graphql-java-servlet Jan 23, 2022
@oliemansm oliemansm added this to the 13.0.0 milestone Apr 2, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants