[hibernate-dev] [ORM] Event Listeners: what's the consequence of not implementing Serializable correctly?
Sanne Grinovero
sanne at hibernate.org
Wed May 17 16:12:40 EDT 2017
On 17 May 2017 at 20:25, Steve Ebersole <steve at hibernate.org> wrote:
> We actually never serialize the SessionFactory and therefore never the
> EventListenerGroup. Our serialized form of a SessionFactory is actually
> just its UUID and its (JNDI) name.
>
> It is completely unnecessary for them to be Serializable. Not to mention it
> make no sense for an interface to force an impl to be Serializable.
Thanks Steve, it's great to see this confirmed. I can cleanup some stuff.
Sanne
>
> On Wed, May 17, 2017 at 9:44 AM Sanne Grinovero <sanne at hibernate.org> wrote:
>>
>> As you might know Hibernate Search is implemented mainly as a complex
>> Event Listener to events
>> from Hibernate ORM.
>>
>> The Hibernate ORM event listener contracts "suggest" that such event
>> listeners need to be Serializable, but it seems our listeners is not
>> actually serializable since some time.
>> It appears to be serializable and there's quite some complexity to
>> make it happen, but I'm realizing that the tests are incomplete and
>> it's unlikely to work in practice.
>>
>> Yet everything seems to be fine: no tests failing, no people
>> complaining, nor bugs have been raised.
>>
>> Does someone know if there's a realistic use case being broken? How
>> would a reasonable test look like?
>>
>> Thanks,
>> 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