[hibernate-dev] Allowing "getListeners" method in ThreadLocal wrapped Sessions

Emmanuel Bernard emmanuel at hibernate.org
Mon Jan 4 06:05:22 EST 2010


We are not proxying SessionImplementor but only Session.
so we would need to
 - proxy SessionImplementor and Session
 - whitelist getListeners

I don't see any issue to that. If nobody objects we can move forward.

On 4 janv. 2010, at 01:16, Sanne Grinovero wrote:

> Hello All,
> when binding the Session to a thread (when using
> org.hibernate.context.ThreadLocalSessionContext) it is currently
> mandatory to start a transaction before any use of the session, this
> includes currently Search.getFullTextSession, mandatory in order to
> use Hibernate Search, as it uses getListener().
> This behaviour was introduced since Search 3.1.1 to prevent other
> trouble with code forgetting to start a transaction it will use
> session.getListeners() as soon as the user calls getFullTextSession
> (HSEARCH-178, which is a workaround for HHH-2763)
> 
> The method "getListeners" is not in the whitelist of allowed methods
> on the session; could this be added?
> I'm referring to the private class TransactionProtectionWrapper in
> org.hibernate.context.ThreadLocalSessionContext, around line 330.
> 
> Could this also be applied to 3.3.x branch? it would help users of
> Search using these core versions, while having no effect impact on
> others uses.
> 
> Regards,
> Sanne
> _______________________________________________
> hibernate-dev mailing list
> hibernate-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/hibernate-dev




More information about the hibernate-dev mailing list