You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 21, 2021. It is now read-only.
When creating a Micronaut application combining H2 and @Cacheable, the following exception is thrown. Running on HotSpot does not throw an exception and the cache is correctly used:
09:56:20.858 [io-executor-thread-1] ERROR i.m.h.s.netty.RoutingInBoundHandler - Unexpected error occurred: Could not obtain transaction-synchronized Session for current thread
org.hibernate.HibernateException: Could not obtain transaction-synchronized Session for current thread
at io.micronaut.transaction.hibernate5.MicronautSessionContext.currentSession(MicronautSessionContext.java:100)
at org.hibernate.internal.SessionFactoryImpl.getCurrentSession(SessionFactoryImpl.java:475)
at io.micronaut.configuration.hibernate.jpa.TransactionalSessionInterceptor.intercept(TransactionalSessionInterceptor.java:56)
at io.micronaut.aop.chain.MethodInterceptorChain.proceed(MethodInterceptorChain.java:82)
at io.micronaut.configuration.hibernate.jpa.TransactionalSession$Intercepted.persist(Unknown Source)
at example.micronaut.GenreRepositoryImpl.save(GenreRepositoryImpl.java:60)
at example.micronaut.$GenreRepositoryImplDefinition$Intercepted.$$access1(Unknown Source)
at example.micronaut.$GenreRepositoryImplDefinition$Intercepted$$proxy1.invokeInternal(Unknown Source)
at io.micronaut.context.AbstractExecutableMethod.invoke(AbstractExecutableMethod.java:146)
at io.micronaut.aop.chain.MethodInterceptorChain.proceed(MethodInterceptorChain.java:73)
at io.micronaut.cache.interceptor.CacheInterceptor.doProceed(CacheInterceptor.java:475)
at io.micronaut.cache.interceptor.CacheInterceptor.interceptSync(CacheInterceptor.java:213)
at io.micronaut.cache.interceptor.CacheInterceptor.intercept(CacheInterceptor.java:131)
at io.micronaut.aop.chain.MethodInterceptorChain.proceed(MethodInterceptorChain.java:82)
at io.micronaut.validation.ValidatingInterceptor.intercept(ValidatingInterceptor.java:139)
at io.micronaut.aop.chain.MethodInterceptorChain.proceed(MethodInterceptorChain.java:82)
at example.micronaut.$GenreRepositoryImplDefinition$Intercepted.save(Unknown Source)
at example.micronaut.GenreController.save(GenreController.java:52)
at example.micronaut.$GenreControllerDefinition$Intercepted.$$access2(Unknown Source)
at example.micronaut.$GenreControllerDefinition$Intercepted$$proxy2.invokeInternal(Unknown Source)
at io.micronaut.context.AbstractExecutableMethod.invoke(AbstractExecutableMethod.java:146)
at io.micronaut.aop.chain.MethodInterceptorChain.proceed(MethodInterceptorChain.java:73)
at io.micronaut.validation.ValidatingInterceptor.intercept(ValidatingInterceptor.java:139)
at io.micronaut.aop.chain.MethodInterceptorChain.proceed(MethodInterceptorChain.java:82)
at example.micronaut.$GenreControllerDefinition$Intercepted.save(Unknown Source)
at example.micronaut.$$GenreControllerDefinition$InterceptedDefinition$$exec3.invokeInternal(Unknown Source)
at io.micronaut.context.AbstractExecutableMethod.invoke(AbstractExecutableMethod.java:146)
at io.micronaut.context.DefaultBeanContext$4.invoke(DefaultBeanContext.java:474)
at io.micronaut.web.router.AbstractRouteMatch.execute(AbstractRouteMatch.java:312)
at io.micronaut.web.router.RouteMatch.execute(RouteMatch.java:118)
at io.micronaut.http.server.netty.RoutingInBoundHandler.lambda$buildResultEmitter$10(RoutingInBoundHandler.java:1363)
at io.reactivex.internal.operators.flowable.FlowableDefer.subscribeActual(FlowableDefer.java:35)
at io.reactivex.Flowable.subscribe(Flowable.java:14918)
at io.reactivex.Flowable.subscribe(Flowable.java:14865)
at io.reactivex.internal.operators.flowable.FlowableSubscribeOn$SubscribeOnSubscriber.run(FlowableSubscribeOn.java:82)
at io.reactivex.internal.schedulers.ExecutorScheduler$ExecutorWorker$BooleanRunnable.run(ExecutorScheduler.java:288)
at io.reactivex.internal.schedulers.ExecutorScheduler$ExecutorWorker.run(ExecutorScheduler.java:253)
at io.micronaut.scheduling.instrument.InvocationInstrumenterWrappedRunnable.run(InvocationInstrumenterWrappedRunnable.java:47)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
at com.oracle.svm.core.thread.JavaThreads.threadStartRoutine(JavaThreads.java:519)
at com.oracle.svm.core.posix.thread.PosixJavaThreads.pthreadStartRoutine(PosixJavaThreads.java:192)
Steps to reproduce:
add implementation("io.micronaut.cache:micronaut-cache-caffeine") to build.gradle
add @Cacheable to GenreRepositoryImpl.findById, for example
build NI (gradlew nativeImage) using GraalVM 20.3 (JDK8 build)
When creating a Micronaut application combining H2 and @Cacheable, the following exception is thrown. Running on HotSpot does not throw an exception and the cache is correctly used:
Steps to reproduce:
implementation("io.micronaut.cache:micronaut-cache-caffeine")
tobuild.gradle
@Cacheable
toGenreRepositoryImpl.findById
, for examplegradlew nativeImage
) using GraalVM 20.3 (JDK8 build)build/native-image/application
)curl -X "POST" "http://localhost:8080/genres" -H 'Content-Type: application/json; charset=utf-8' -d $'{ "name": "musicX" }'
)The text was updated successfully, but these errors were encountered: