-->
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.  [ 2 posts ] 
Author Message
 Post subject: Swarmcache NullPointerException
PostPosted: Tue Jan 27, 2004 11:43 am 
Beginner
Beginner

Joined: Tue Oct 28, 2003 12:09 pm
Posts: 46
I've worked around this, but I thought I would post it in case it's not expected or in case someone else runs into it:

If I don't wrap my buildSessionFactory() call in a synchronized block, there would be cases where the session factory singleton was getting created twice.

Seems like no killer problem, but when it happened I would get a slew of errors from CacheFactory:

Code:
ERROR CacheFactory:89 - Cache of type [edu.academyart.model.Post] already exists.


And then I would get NullPonterException from SwarmCache.get when I tried to load one of my objects:

Code:
java.lang.NullPointerException
   at net.sf.hibernate.cache.SwarmCache.get(SwarmCache.java:27)
   at net.sf.hibernate.cache.NonstrictReadWriteCache.get(NonstrictReadWriteCache.java:35)
   at net.sf.hibernate.impl.SessionImpl.doLoad(SessionImpl.java:2033)
   at net.sf.hibernate.impl.SessionImpl.doLoadByClass(SessionImpl.java:1916)
   at net.sf.hibernate.impl.SessionImpl.load


I've fixed this problem in my code but I wanted to toss it out there in case it was also revealing a problem in the SwarmCache implementation of the object cache.

-mp


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 27, 2004 7:39 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Can you post it to JIRA please?

_________________
Emmanuel


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.