Skip to main content
edited body
Source Link
Simon Mbatia
  • 301
  • 1
  • 3
  • 9

This is what I use and works for me. Downcast the Session methodobject into a SessionImpl and get the connection object easily:

SessionImpl sessionImpl = (SessionImpl) session;
Connection conn = sessionImpl.connection();

where session is the name of your Hibernate session object.

This is what I use and works for me. Downcast the Session method into a SessionImpl and get the connection object easily:

SessionImpl sessionImpl = (SessionImpl) session;
Connection conn = sessionImpl.connection();

where session is the name of your Hibernate session object.

This is what I use and works for me. Downcast the Session object into a SessionImpl and get the connection object easily:

SessionImpl sessionImpl = (SessionImpl) session;
Connection conn = sessionImpl.connection();

where session is the name of your Hibernate session object.

Source Link
Simon Mbatia
  • 301
  • 1
  • 3
  • 9

This is what I use and works for me. Downcast the Session method into a SessionImpl and get the connection object easily:

SessionImpl sessionImpl = (SessionImpl) session;
Connection conn = sessionImpl.connection();

where session is the name of your Hibernate session object.