This week's book giveaway is in the Cloud/Virtualizaton forum.
We're giving away four copies of Mesos in Action and have Roger Ignazio on-line!
See this thread for details.
Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

EJB Passivation Question

 
Bradley Rintoul
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello. Quick question about "best practices" here, maybe...

So, I have a stateful session bean that is using a Logger (org.apache.log4j style). I was keeping a reference to it as a member variable, but then realized it is unserializable... Should I just make calls to Logger.getLogger() all the time? Is this expensive?

Thanks for any advice/help.

B.
 
Amit M Tank
Ranch Hand
Posts: 257
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Make your logger member variable static.

Thanks,
 
Bradley Rintoul
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Amit M Tank:
Make your logger member variable static.


Now why didn't I think of that?!?

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic