This week's book giveaway is in the HTML Pages with CSS and JavaScript forum.
We're giving away four copies of Testing JavaScript Applications and have Lucas da Costa on-line!
See this thread for details.
Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

EJB method and IO operation

 
clojure forum advocate
Posts: 3479
Mac Objective C Clojure
  • Mark post as helpful
  • send pies
  • 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
  • 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.
 
Are you here to take over the surface world? Because this tiny ad will stop you!
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic