Hibernate : No CurrentSessionContext configured

As per the best of my knowledge, your configuration is not proper for current session. Instead of

<property name="hibernate.current_session_context_class">org.hibernate.context.ThreadLocal‌​SessionContext</property>

use

<property name="hibernate.current_session_context_class">thread</property>

For more information on this, please visit this link:

http://docs.jboss.org/hibernate/orm/3.3/reference/en/html/architecture.html#architecture-current-session

Specially, read the last lines of last paragraph.

For those who’re using Hibernate 4.1,

<property name="hibernate.current_session_context_class">org.hibernate.context.internal.ThreadLocalSessionContext</property>

Reference: https://docs.jboss.org/hibernate/orm/4.1/javadocs/org/hibernate/context/internal/ThreadLocalSessionContext.html

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)