Win a copy of Java 9 Modularity: Patterns and Practices for Developing Maintainable Applications this week in the Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Files from Ejb  RSS feed

 
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
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!