Menemukkan error No CurrentSessionContext configured! di hibernate

Cuma sekedar share saja karena mungkin ada yg menemukkan error seperti saya…hehehe..
menemukkan error seperti ini :

INFO: indexes: [primary]
Mar 4, 2011 5:52:36 PM org.hibernate.tool.hbm2ddl.SchemaUpdate execute
INFO: schema update complete
org.hibernate.HibernateException: No CurrentSessionContext configured!
        at org.hibernate.impl.SessionFactoryImpl.getCurrentSession(SessionFactoryImpl.java:542)
        at org.phonebook.control.HibernateUtil.getCurrentSession(HibernateUtil.java:40)
        at org.phonebook.control.PhonebookCon.insert(PhonebookCon.java:21)
        at org.phonebook.view.FrameMain.InsertActionPerformed(FrameMain.java:465)
        at org.phonebook.view.FrameMain.access$000(FrameMain.java:23)

untuk mengatasinya kunjungi file hibernate.cfg.xml kemudian tambahkan


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

tambahkan code diatas sesuai urutan jangan dibawah mapping karena akan menimbulkan error…

semoga bermanfaat…:D

2 thoughts on “Menemukkan error No CurrentSessionContext configured! di hibernate

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s