I have a JDBC Connection at runtime, and wrap it into a SingleConnectionDataSource (suppressClose). How can I use it to build a SessionFactory, which will be used in a HibernateDaoSupport? I tried to use LocalSessionFactoryBean, but it is supposed to be used at configuration time, not runtime.
The bigger question is how to use an always-open session (connection) in Spring and Hibernate? I am tired of "owning session closed" errors.


Reply With Quote