/**
*
* Org.hibernate.HibernateException:No Session found for current thread
* Analysis: Getcurrentsession () is related to the current transaction
*
* Process of Spring hibernate transaction
*
* 1. Before the method starts
*①. Getting session
*②. Bind the session to the current thread so that you can use the sessionfactory in the DAO
* Getcurrentsession () method to get the session
*③. Opening a transaction
*
* 2. Execution of Business methods
* 1) exception occurred
*①. Rolling back a transaction
* 2) Normal end
*①. Committing a transaction
* finally{
*②. Unbind the session with the current thread binding
*③. Closing session
* }
*
* Conclusion:
* As long as you use Getcurrentsession () to get the session,
*① must configure the transaction
*② must include all business methods when configuring transaction properties
*/
Analysis Org.hibernate.HibernateException:No Session found for current thread