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
Caused by: jakarta.enterprise.context.ContextNotActiveException: Cannot use the EntityManager/Session because neither a transaction nor a CDI request context is active. Consider adding @Transactional to your method to automatically activate a transaction, or @ActivateRequestContext if you have valid reasons not to use transactions.
at io.quarkus.hibernate.orm.runtime.session.TransactionScopedSession.acquireSession(TransactionScopedSession.java:107)
at io.quarkus.hibernate.orm.runtime.session.TransactionScopedSession.setDefaultReadOnly(TransactionScopedSession.java:671)
at org.hibernate.engine.spi.SessionLazyDelegator.setDefaultReadOnly(SessionLazyDelegator.java:157)
Is there anything I can do? My current workaround is to put the EM into-Readonly-Model upon first access, which is not too bad but it feels wrong to just make the tests succeed.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I've a base class like this:
Starting quarkus in Dev-Mode all is fine but when trying to write a JUnit-Tests like this:
leading to the following exception
Is there anything I can do? My current workaround is to put the EM into-Readonly-Model upon first access, which is not too bad but it feels wrong to just make the tests succeed.
Beta Was this translation helpful? Give feedback.
All reactions