Help coderanch get a
new server
by contributing to the fundraiser
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

Suggestion about making entity classes Serializable

 
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello! I'm integrating JForum into our webapp now and ran over the serious (at least for me) issue.

I'm using JForum 2.1.7 on JBoss 4. I'm required to manage JForum entites from a separate webapp, so I start up separate copy of ForumRepository and friends in it. Because I need repositories (of my & JForum's webapps) to be synchronized, I wrote MBeanTreeCacheEngine that uses tree cache deployed as JBoss service. So I faced the fact that entites from different webapps are loaded by different classloaders. To solve it, I serialize entities before putting them in cache.

Then I encountered terrible bugs when some things just dissapear from forum. I debugged this to reason that when you serialize entitiy with non-serializable fields (other entities), serialization engine just silently skips them!

So I suggest to make all classes in net.jforum.entities serializable to make them really cacheable - you do require it for stand-alone (not embedded) cache (there are other ways, like in Hibernate, but they are way more complicated). Note that for now many of them already are serializable, but some are not.
[originally posted on jforum.net by skoptelov]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Slightly offtopic, but I filed one more of the cache-related bugs in JIRA:

http://www.jforum.net/jira/browse/JF-613
[originally posted on jforum.net by skoptelov]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, you're right. In order to send the objects through the network, they need to be serializable.

Please open a Jira issue for that one too.

Rafael
[originally posted on jforum.net by Rafael Steil]
 
reply
    Bookmark Topic Watch Topic
  • New Topic