Title: EJB File I/O question
Use DAO (Data Access Object) Pattern.
 
Babu
-----Original Message-----
From: Laurel Neustadter [mailto:[EMAIL PROTECTED]]
Sent: Friday, September 28, 2001 10:44 AM
To: [EMAIL PROTECTED]
Subject: Re: EJB File I/O question

Hi Sourabh:
 
Are you proposing the new layer be in a different process (e.g., in a RMI server)? If so, then I agree this solution satisfies the spec.
 
If you are proposing just a new logical layer (e.g., the bean references another class, which does the file i/o), then it seems to me this still violates the spec.
 
To Everyone:
 
As many others have noted, many app servers let you do file i/o, so in practice file i/o can often be done from within an EJB (directly by the bean or indirectly by the bean calling methods in other classes). This seems to indicate that in practice, there is a need for this.
 
Does anyone know the underlying reasons why the spec prohibits file i/o?
 
My impression is beans shouldn't access the local file system since such a solution may no longer work if clustering is used (but using a file on a networked drive might get around this), and also beans that make assumptions about the local file system might not be portable.  These seem like weak reasons for prohibiting file i/o, however. I'm assuming there must be better reasons I haven't thought of.
 
Laurel
-----Original Message-----
From: Sourabh Ahuja [mailto:[EMAIL PROTECTED]]
Sent: Thursday, September 27, 2001 11:28 PM
To: [EMAIL PROTECTED]
Subject: Re: EJB File I/O question

Hi
 
Introduce one more layer between your EJB and DB or file. Your EJB will call the write methods of that layer and those methods will be responsible for writing it to the file. In Short
 
EJB( call write methods on the new Layer)  ------->     New Layer ( Contains methods for openning the streams for writing) ---------> Final file.
 
Cheers,
Sourabh
-----Original Message-----
From: Dinesh Sharma [mailto:[EMAIL PROTECTED]]
Sent: Thursday, September 27, 2001 7:46 PM
To: [EMAIL PROTECTED]
Subject: EJB File I/O question

Hello all,
        Am currently working on an application, which requires writing to a file, everytime some data is retrieved from the DB. It is a daily process, and the first transaction is a write, and then all the subsequent trasactions are appended to the file. I learnt that EJB specification 1.1 forbids "developers" from using the java.io.* package for doing file I/O. Is anyone aware of any alternative method/pattern or a stable workaround to around this? Thank you for your time in advance.

I could compile a list of all the messages I receive and send it back to the list.

Best,
Dinesh

The information in this email and in any attachments thereto is confidential and may be legally privileged. It is intended solely for the addressee. Access to this email by anyone else is unauthorized. If you are not the intended recipient, any disclosure, copying, distribution or any action taken or omitted to be taken in reliance on it, is prohibited and may be unlawful.

Reply via email to