From: Christian B. (JIRA) <no...@at...> - 2006-07-28 22:08:20
|
Add getCurrentSession(Map) method to pass options to custom implementations --------------------------------------------------------------------------- Key: HHH-1955 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1955 Project: Hibernate3 Type: New Feature Components: documentation, core Reporter: Christian Bauer Priority: Minor There are a few borderline usecases in HibernateTemplate that can be implemented with CurrentSessionContext ("enable query caching for all queries from this Session", "Enable flushmode by default", etc.). If I want to implement this right now without HibernateTemplate, I'd write a CurrentSessionContext that does the magic before returning a Session (e.g. set a flushmode). This is more difficult if you want to have one CurrentSessionContext that can do several things (like proxy a Session so that all queries are cachable, enable a flushmode when the session is opened, etc.) - you'd need a way to pass some arguments into the SF-scoped CSC. Instead of threadlocals I'd say we should provide an overloaded getCurrentSession(Map) so that any implementor can handle a custom set of parameters. Not sure this is a good idea, because all the use cases that have been named so far are theoretical and are extremely unlikely to happen in practice. However, they are used for the marketing of the HibernateTemplate. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |