Hey
Laird Nelson wrote:
> Assaf Arkin wrote:
> > You may use input/output streams, reader/writer etc. You just
> > can't use FileReader/FileInputStream and their like. You can use sockets
> > either, though you can obtain a URL or even a file through the URL
> > factory.
>
> I guess what I'm trying to figure out is the nature of the prohibition.
> Is the prohibition really as harsh as it reads for technical reasons?
> Or does it exist to protect idiot programmers from keeping a filehandle
> open when their bean is passivated?
IMHO the reasons are the following:
1. Portability
2. Portability
3. Portability
4. Security (=from bugs, from beans reading files they shouldn't, etc.)
This is in line with the goal of J2EE: WORA (=portability) on the
server.
No "technical" reasons. Just because it's possible, doesn't mean it's a
good idea.
> That is, I can't see any technical reason why I can't read from a file
> provided I open and close the FileReader (let's say) within the
> currently executing method. I obviously understand why I shouldn't
> stash a reference to a FileReader in a member field somewhere and expect
> it to keep state between activations and passivations. But it seems to
> me that as long as I open and close the stream during the method
> execution I should be OK in all EJB servers.
A properly implemented server will not allow you to open streams during
method invocations. This is enforced by applying the proper security
policy.
/Rickard
--
Rickard �berg
@home: +46 13 177937
Email: [EMAIL PROTECTED]
http://www.dreambean.com
Question reality
===========================================================================
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".