The spec DOES NOT PROHIBIT ACCESSING LOCAL FILES. What it recommends against is the use of java.io packages. And it does so because the use of java.io packages for reading files may sacrifice the portability of your bean.
So the news is, unless you a purist, if it works on your EJB server, and you have no plans to move or sell, you can relax and finish your deployment. //Nicholas --- Laurel Neustadter <[EMAIL PROTECTED]> wrote: > 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 > > ===== Nicholas Whitehead Home: (973) 377 9335 Cell: (973) 615 9646 Work(@ JP Morgan): (212) 235 5783 [EMAIL PROTECTED] __________________________________________________ Do You Yahoo!? Listen to your Yahoo! Mail messages from any phone. http://phone.yahoo.com =========================================================================== To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff EJB-INTEREST". For general help, send email to [EMAIL PROTECTED] and include in the body of the message "help".
