Deprecate the Session.connection() method
Description
is a fix for
relates to
Activity
Paul Benedict August 12, 2009 at 7:16 PM
Ana, see for the alternative.
Ana Carolina August 5, 2009 at 7:50 PM
Hellow,
I need to call an oracle stored procedure which does not return a resultset or cursor, but it return a NUMBER.
According to Hibernate documentation "they are not usable with Hibernate. If you still want to use these procedures you have to execute them via session.connection()."
Problem is that session.connection() generates exception:
java.lang.IllegalArgumentException: interface org.hibernate.jdbc.ConnectionWrapper is not visible from class loader
Do I have any alternative?
Thanks in advanced.
Dilip Dalton December 19, 2008 at 8:31 PM
Steve, thanks for describing the work API.
We can use this work API, but it will involve a bigger refactoring work compared to obtaining the JDBC connection object. Given how stable and mature the code has been, it is highly likely that we will never do this refactoring on the legacy code.
Paul Benedict December 19, 2008 at 7:52 PM
What about moving the connection() method to the "classic" package? Maybe a Session3 interface would help the migration.
Steve Ebersole December 19, 2008 at 6:49 PM
Shawn, I am responding specifically to the questions that keep cropping up on this specific issue which invariable seem to discuss exactly this type of usage.
Its been discussed (and I thought you were involved in some of them) that yes there still needs to be an API for obtaining a 'child session' (specifically one utilizing the same JDBC connection). This will happen before 4.0. The rub, to me, is the already large number of overloaded SF.openSession() methods we have; that needs to be considered carefully. But honestly I have not had time to think through the details of it; feel free to put some thought into it and start a discussion on the dev list. (BTW Session.getSession(EntityMode) has a totally different purpose/intent)
Deprecate the Session.connection() method, in favor of a "JDBC work" API. Schedule for removal in 4.0