• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Cache give nullpointer after hot deployed in Tomcat

 
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This craps out because it doesn't hit the DB when the cache gets cleared out after hot deploy.

Topic topic = TopicRepository.getTopic(new Topic(topicId));

The DB access layer is crying for Hibernate.

Simon

[originally posted on jforum.net by Anonymous]
 
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
By "craps out" I meant topic is returned as NULL and I had to do

Topic topic = TopicRepository.getTopic(new Topic(p.getTopicId()));

if (topic == null) {
topic = DataAccessDriver.getInstance().newTopicDAO().selectRaw(p.getTopicId());
}

IMO, the app layer shouldn't need to worry about this. When it asks for a legitimate Topic, TopicRepository should do all the heavy lifting and refill the tank when the water is empty. Now this checking is littered all over the place...
[originally posted on jforum.net by Anonymous]
 
this llama doesn't want your drama, he just wants this tiny ad for his mama
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic