-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 
Author Message
 Post subject: Configuration serialization error: filterDefinitions map
PostPosted: Tue Apr 18, 2006 10:57 am 
Regular
Regular

Joined: Tue Mar 22, 2005 2:27 am
Posts: 62
Hi All,

I am trying to speed up my deployment times by serializing my configuration to disk to avoid always needing to parse the mappings on startup.
The following JIRA posts seem to indicate that this should work:

http://opensource.atlassian.com/project ... wse/HB-147 (see Gavin's comment)
http://opensource.atlassian.com/project ... wse/HB-492 (see Max's comment)

However, it seems that the filterDefinitions contained in the Configuration object are not serializable and are causing the following error.

I am using hibernate-3.1.2 but also had a quick peek at hibernate-3.2.alpha2's source and it seems to also have the same problem.
Could this be a regression?
Am I missing something?

Here is the code:

Code:
Configuration cfg = new Configuration().configure("hibernate.cfg.xml");
         
ObjectOutputStream oos = new ObjectOutputStream( new FileOutputStream( filename ) );
oos.writeObject( cfg );
oos.close();


Here's the stack trace:
Code:
java.io.NotSerializableException: org.hibernate.engine.FilterDefinition
   at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1054)
   at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:278)
   at java.util.HashMap.writeObject(HashMap.java:986)
   at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:324)
   at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:809)
   at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1296)
   at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1247)
   at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1052)
   at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1332)
   at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1304)
   at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1247)
   at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1052)
   at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:278)


Thanks,

Frank 'Grimey' Grimes


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 18, 2006 3:06 pm 
Regular
Regular

Joined: Tue Mar 22, 2005 2:27 am
Posts: 62
Also tested with hibernate-3.2.0.cr1.
The same error occurs there, too.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 18, 2006 5:03 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
put in jira and i'll fix it.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 18, 2006 5:21 pm 
Regular
Regular

Joined: Tue Mar 22, 2005 2:27 am
Posts: 62
Here's the JIRA:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-1674


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.