This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes EJB and other Java EE Technologies and the fly likes EJB Passivation Question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "EJB Passivation Question" Watch "EJB Passivation Question" New topic
Author

EJB Passivation Question

Bradley Rintoul
Greenhorn

Joined: Apr 01, 2003
Posts: 14
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

Joined: Mar 28, 2004
Posts: 257
Make your logger member variable static.

Thanks,


Amit Tank
Linked In
Bradley Rintoul
Greenhorn

Joined: Apr 01, 2003
Posts: 14
Originally posted by Amit M Tank:
Make your logger member variable static.


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

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: EJB Passivation Question