Closed hannibal218bc closed 1 year ago
You can use the doReturningWork
method against the Session
, and it will work the same even if the SessionDelegator
is used:
Connection connection = session.doReturningWork(c -> c);
Thanks!
You're welcome.
Hi,
some places in the application I'm analyzing retrieve the
java.sql.Connection
from aSession
like this:When using the optimizer, the session objects are of type
SessionDelegator
and the above code doesn't work. However, the type already has apublic Session getOriginalSession()
method, so I'd like to do something like this:However,
SessionDelegator
is not visible... would it be possible to add a common supertype for the various delegators, and thepublic getOriginalSession()
declaration there? Or is there a better way to achieve this...?Thank you!