[hibernate-issues] [Hibernate-JIRA] Updated: (HHH-2960) Add Interceptor to the openSession method the CurrentSessionContexts use
Shawn Clowater (JIRA)
noreply at atlassian.com
Mon Sep 8 11:46:04 EDT 2008
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-2960?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Shawn Clowater updated HHH-2960:
--------------------------------
Attachment: HHH-2960-3.3.SP1.patch
Updated patch for use on 3.3 SP1, it's probably the same as the previous one but I thought I'd at least give this one a bump and make it as painless as possible to have it integrated.
> Add Interceptor to the openSession method the CurrentSessionContexts use
> ------------------------------------------------------------------------
>
> Key: HHH-2960
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2960
> Project: Hibernate3
> Issue Type: Improvement
> Components: core
> Affects Versions: 3.2.5
> Reporter: Shawn Clowater
> Priority: Minor
> Attachments: HHH-2960-3.3.SP1.patch, HHH-2960.patch
>
>
> Ran into a minor snag earlier where I was rigging up the stateful audit interceptor and didn't have a clean hook to jack the interceptor for my current session.
> The sample code illustrates the use of the interceptor by using the sessionFactory.openSession(Interceptor) method and then goes on to say with the wave of a hand that if you're using the getCurrentSession functionality that you'll have to override whatever CurrentSessionContext you're using. That's a little bit more cumbersome that I was hoping for but to make matters worse the method that the ThreadLocalCurrentSessionContext is using to obtain the session is:
> public org.hibernate.classic.Session openSession(
> final Connection connection,
> final boolean flushBeforeCompletionEnabled,
> final boolean autoCloseSessionEnabled,
> final ConnectionReleaseMode connectionReleaseMode) throws HibernateException;
> There are no other constructors that I can see that combine all of these parameters with the addition of an Interceptor parameter. It would be a nice to have if there were an overloaded method that accepted the addition of an Interceptor.
> I worked around it for now but I am ashamed at the way I'm storing state for my interceptor.
--
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
More information about the hibernate-issues
mailing list