• 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

ResourceBundle instead of I/O in EJB

 
Trailboss
Posts: 23778
IntelliJ IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I know that I/O violates "bean law", but it looks like using the ResourceBundle stuff does not.
Is using ResourceBundle within EJB following bean law?
 
Saloon Keeper
Posts: 27762
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Actually, the reason listed in the spec is because java.io.* isn't "well-suited" compared to things like JDBC for business data access. Sounds a little murky to me.
If you use the resource bundle manager you wouldn't (directly) be using java.io, but the access is read-only.
 
sharp shooter, and author
Posts: 1913
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
And I guess that there's nothing stopping you from using a JDBC-backed ResourceBundle.
 
Ranch Hand
Posts: 228
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What is JDBC backed ResourceBundle.....First time i am hearing of such a thing and would like to know more :roll:
Simon, Out with all the kitties in that bag
 
Simon Brown
sharp shooter, and author
Posts: 1913
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by sandy ind:
Simon, Out with all the kitties in that bag



Well a ResourceBundle is an abstract class, with concrete implementations including a properties file backed bundle, where the resources are loaded from a properties file. So why not write another concrete implementation that loads the resources from a database?
[seems a little off-topic from J2EE/EJB now!]
Simon
 
Ranch Hand
Posts: 775
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Tim Holloway:
[QB]Actually, the reason listed in the spec is because java.io.* isn't "well-suited" compared to things like JDBC for business data access. Sounds a little murky to me.
I'm not sure what the wording of the spec is, but I can think of a practical reason for avoiding I/O in EJB. I/O operations can block. Blocking makes threads unrunnable. You aren't managing the threads, the EJB container is. The container won't know what you did (at least not without a lot of introspective effort). Doesn't sound like a great situation for holding a container responsible for managing resources.

 
Whoever got anywhere by being normal? Just ask this exceptional tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic