Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Files from Ejb

 
Angelino Dolce
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all!
One of the restrictions of EJB is:
------------------------------------------------------------------------
An enterprise bean must not use the java.io package to attempt to access files and directories in the file system.
------------------------------------------------------------------------
But i've the necessity of writing temporarily a file on disc,reread it and then cancel. What is a recommended solution for this problem?
Thank You very much!
 
Nicholas Cheung
Ranch Hand
Posts: 4982
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can use a DAO with your EJBs. The access of files can be delicated to the DAO and thus, the EJBs will not encounter any I/O operations.

Nick
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!