A, No transactionmanagerlookup specified! The general meaning is: There is no transaction management finder specified! Second, let's have a little interest in hibernate transaction processing!
(1) Hibernate is a lightweight object encapsulation of JDBC, hibernate itself does not have the transaction processing function, Hibernate's transaction is actually the underlying JDBC Transaction encapsulation (Local transaction: Simple database only one), or JTA transaction package (all transactions: Simply say that the database has multiple);
(2) Following our detailed analysis:
The 1.Hibernate can be configured as Jdbctransaction or Jtatransaction, depending on your configuration in hibernate.properties:
[HTML]View PlainCopy
- * If you are using a local transaction (JDBC Transaction)
- < name="Hibernate.current_session_context_class">thread</ Property >
- * If you are using a global transaction (JTA Transaction)
- < name="Hibernate.current_session_context_class">jta</Property >
2. If you do not configure anything, use jdbctransaction! by default Whether you're going to let hibernate use Jdbctransaction or jtatransaction!
Third, problem solving
(1) This reminds us of the way we use hibernate to handle transactions, one of which is opensession () and Getcurrentsession ()
(2) The method owner who needs the above configuration is getcurrentsession ()! OK the cause of the problem to find! Change your opensession () to Getcurrentsession ()!
If you want to know more about the opensession () and Getcurrentsession () methods, visit: http://blog.csdn.net/xlgen157387/article/details/39777827
NOTE: Reprint please indicate the source!!
Parse the error principle and resolve Hibernate no transactionmanagerlookup specified! Error