If you store anything in Infinispan, it should at the very least be
Serializable.

A better solution would be to provide custom Externalizers:
https://hibernate.atlassian.net/browse/OGM-37

On 3 February 2014 10:56, Gunnar Morling <gun...@hibernate.org> wrote:
> Hi,
>
> I'm wondering why org.hibernate.ogm.grid.AssociationKey implements
> Serializable. When is it actually serialized?

When you use Infinispan in clustered mode.

>
> I'm suspecting the answer is "never", as the type of the "metadata" member
> is not serializable, so I'd expect a NotSerializableException to be raised.

Our problem is probably that we don't have integration tests using
Infinispan in modes other than "Local".
I suspect I avoided making them as they make the testsuite slower, but
it seems you just highlighted an important reason to add them :-/

>
> If so, does anything speak against making AssociationKey not implement
> Serializable?

It's needed. Also I think it's an important "warning flag" in terms of
design: never consider hooking references to services in such a key,
and strive to keep it as a very simple value holder.

-- Sanne

>
> Thanks,
>
> --Gunnar
> _______________________________________________
> hibernate-dev mailing list
> hibernate-dev@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/hibernate-dev
_______________________________________________
hibernate-dev mailing list
hibernate-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/hibernate-dev

Reply via email to