When hibernate is used for the first time, no currentsessioncontext configured
Solution:
1. For web applications, add
in hibernate.cfg.xml
<property name="current_session_context_class">jta</property>
2. For Java applications, add
in hibernate.cfg.xml
<property name="current_session_context_class">thread</property>
Similar Posts:
- How hibernate 3 used in jbpm4.4 is compatible with spring 5.X and the exception caused by: java.lang.classnotfoundexception: org.hibernate.impl.sessionimpl
- AOP Configuration Services error: javax.persistence.TransactionRequiredException: no transaction is in progress
- Thread.currentThread().getContextClassLoader()Class.getClassLoader()
- Hibernate:No default constructor for entity [How to Solve]
- jpa–No Persistence provider for EntityManager named xx
- [transfer] could not resolve placeholder solution
- [Solved] org.hibernate.MappingException: Unknown entity
- MappedBy reference an unknown target entity property [How to Solve]
- Failed to bind properties under
- An error occurs when springboot sets the log level [How to Solve]