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

EJB and file read/write

 
Ranch Hand
Posts: 208
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have the following method in my EJB
method1(){
...
myFileReader.readFile("file Name");
}
In the above code, instead of reading the file in EJB (Which shouldn't be done as the container doesnt guarantee proper behaviour), the operation is delegated to "myFileReader" class readFile() method.
1. Does the container gurantee a proper behaviour in this case since iam not reading any file in EJB ? if yes, i feel iam reading the file indirectly.
2. If i want to read some file in an EJB, whats the best solution ?
 
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
this is an interesting question.
i wonder if the class is executed in the container environment or not.
sorry i can't help, but i will follow this topic.
 
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
Since there is no mention about the contents/size of the file to be read, for a moderate file size with approx. 1000 lines of name/value pairs,
I 'd read the file when the server starts up, cache it and use it in EJb or elsewhere.

Suresh Selvaraj
SCJP2
 
Hari babu
Ranch Hand
Posts: 208
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
What if the file to be read/written is dependent on the user session which is stored as stateful session bean ?
Hari
[ April 24, 2003: Message edited by: Hari babu ]
 
moose poop looks like football shaped elk poop. About the size of this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic