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

Sanne Grinovero sanne at hibernate.org
Wed Sep 26 08:55:22 EDT 2012


quoting IRC conversation:

<sebersole> sannegrinovero: ah i remember why...
<sebersole> Configuration
<sebersole> we have tests that explicitly test serializing Configuration
<sebersole> and services not being Serializable can cause those to fail
<sebersole> of course thats a transitory concern
<sebersole> like i said in the email prior to emmanuel's semi-harsh
reply... i dont think it is really necessary
<sannegrinovero> ah, if it's transitory would you accept a patch to
remove the comment and the "extends Serializable" ?
<sannegrinovero> I can replace the comment with a "soft requirement"
for some services explicitly needed in tests
<sebersole> no, i would not accept such a patch...
<sebersole> but you could make that change if you want
<sebersole> :)
<sebersole> just run the tests first
<sannegrinovero> you mean I should push it directly?
<sebersole> yep

On 26 September 2012 13:38, Emmanuel Bernard <emmanuel at hibernate.org> wrote:
> 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