File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Property file in EJB: previously called "Thread in Stateless Session Bean"

 
Jes Sie
Ranch Hand
Posts: 188
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This spins off from this thread,
Thread in Session Bean
I have a need to access property files from a Stateless Session Bean. What are the best practices to do this. Approaches that I can think of are: -
1. ResourceBundle theResource = ResourceBundle.getBundle("myPropertyFile");
2. JNDI
3. Any other suggestions?
If so, what are the tradeoffs for each of these approaches in terms of performance & scalability?
 
Tim Holloway
Saloon Keeper
Pie
Posts: 17621
39
Android Eclipse IDE Linux
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A resource is a better bet for storing "large" numbers of objects and/or larger sized objects, since it's strictly file I/O.
My mind is out to lunch on whether JNDI is ALWAYS going to be associated with a network server at the moment, but everything I can think of at the moment looks that way. Given a choice between file I/O and network I/O, use the file unless there's a compelling reason not to - for example sharing frequently-modified data in a cluster. (Then again, THAT's a good use for an EJB itself!).
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic