• 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

EJB method and IO operation

 
clojure forum advocate
Posts: 3479
Mac Objective C Clojure
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi.
My EJB reads some files from the hard drive.
The problem is that the reading process is taking a long time or even it is hanging up.
Do you suggest a solution for this problem ?
Thanks for help.
 
Bartender
Posts: 1638
IntelliJ IDE MySQL Database Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by John Todd:
Hi.
My EJB reads some files from the hard drive.
The problem is that the reading process is taking a long time or even it is hanging up.
Do you suggest a solution for this problem ?
Thanks for help.



Correlating with the other topic you have posted, i think your problem is of transaction timeout.
If that is the problem then i can think of the following options:
1) Increase the tx timeout period. However, this is not at all a neat solution as determining a big enough transaction timeout to account for all processing delay is not possible.
2) Try if you can actually move to an asynchronous model.
3) Try creating an entity that reads the file contents for you and once read it caches the contents in memory. (Assure either all modification to the file goes through this entity or it gets a callback for the changes done on the file.) You can load this entity on application startup and then the EJB can query this entity for the data.

Hope it helps.
 
reply
    Bookmark Topic Watch Topic
  • New Topic