[hibernate-dev] [ORM] Event Listeners: what's the consequence of not implementing Serializable correctly?

Steve Ebersole steve at hibernate.org
Wed May 17 15:25:32 EDT 2017


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.

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