Hi All,
I'm using Spring 3, Hibernate & JPA 1 for my web app & mysql as the DB server
I want to retrieve the native Connection object from the entitymanager. How can I do this?
After much research on this, I tried with this code
But this is giving NPE (session being null, I guess) & more over .connection() method is deprecated.Code:org.hibernate.Session oSession = (org.hibernate.Session)((this.oJPATemplate.getEntityManager()).getDelegate()); oSession.connection();
The reason i need connection object is that i must be able to access the temporary tables.
If i do a
then a new connection is established and hence i cannot access the temporary tableCode:datasource.getConnection()
Thank you


Reply With Quote