While it is true that the Session returned from SessionFactory#getCurrentSession may report Session#equals incorrectly, your analysis wrt SessionImpl is completely inaccurate. SessionImpl does not override #equals; its "impl" is just fine. What you observe is instead a problem with the wrapping of said Session for ThreadLocalSessionContext handling. ThreadLocalSessionContext.TransactionProtectionWrapper ought to explicitly handle #equals itself checking the proxy instance rather than delegating that call to the "real" Session. |