[hibernate-dev] Why do Services need to be Serializable?

Emmanuel Bernard emmanuel at hibernate.org
Wed Sep 26 08:38:41 EDT 2012


On Wed 2012-09-26 13:24, Sanne Grinovero wrote:
> I just found this comment on org.hibernate.service.Service:
> 
> /**
>  * Marker interface for services.
>  * <p/>
>  * NOTE : All services must be {@link Serializable}!
>  *
>  * @author Steve Ebersole
>  */
> public interface Service extends Serializable {
> 
> 
> What kind of bad things will happen to us if violating this recommendation?
> 
> In OGM we have for example connection pools managed in a Service, we
> can hardly serialize that.

Well with a bit of work we could make such services serializable but it
seems the equivalent services for ORM are not necessarily making this
effort.


More information about the hibernate-dev mailing list