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
Does it properly work on non-transactional query?
As you can see, It uses invoke() to unwrap Session but it throws IllegalStateException when the query is non transaction.
This is because it uses ThreadLocal Internally to get EntityManager and the ThreadLocalbindResource() which set the entityManager is called only when use transaction.
How can I fix it(or is it can be fixed)?
The text was updated successfully, but these errors were encountered:
If you would like us to spend some time helping you to diagnose the problem, please spend some time describing it and, ideally, providing a minimal sample that reproduces the problem. We require more contextual details to find out how you're using JPA.
Related to #2370.
When executing query, below code is run before create query.
Does it properly work on non-transactional query?
As you can see, It uses
invoke()
to unwrap Session but it throwsIllegalStateException
when the query is non transaction.This is because it uses
ThreadLocal
Internally to getEntityManager
and theThreadLocal
bindResource() which set the entityManager is called only when use transaction.How can I fix it(or is it can be fixed)?
The text was updated successfully, but these errors were encountered: