The container can prevent you from using IO if it defines a server
security policy file that denies java.io.FilePermission and you don't
have control over changing it (ie: you're not the admin).
Concerning "shutting down the EJBs gracefully," - I dunno. Maybe it's a
container thing per vendor, but I would *hope* that on shutdown it
would wait till all active EJBs finish with their current threads of
execution. That way when my business method returns I've gone through
the trouble of closing all my streams, etc.
I guess you can't be sure about either of the above things, though -
which is probably why they discourage it in the spec. Geeze, I wish
there was a File ResourceFactory like for JDBC. I wonder if I could use
the Connector stuff...
David
--
Brook Stevens wrote:
> I believe the issue is that the if the container is not managing the IO,
> then it cannot garentee that when it is shutdown that the IO process
> terminates gracefully. I don't think there is anything a container could
> really do to prevent you from useing IO, but if the app is shutdown then in
> theory it should be able to shutdown itself and your EJB's gracefully, and
> it cannot do this if there are opened reasources it does not know
> about...please feel free to correct me if I am wrong though.
>
>
>
>
> -----Original Message-----
> From: David Ward [mailto:[EMAIL PROTECTED]]
> Sent: Monday, July 16, 2001 11:48 AM
> To: [EMAIL PROTECTED]
> Subject: Re: [JBoss-user] EJB spec and java.io restrictions
>
>
> But the only files I write to are ones returned by
> File.createTempFile(...), which are guaranteed to be unique...
>
> --
>
> Peter Wone wrote:
>
>
>>File I/O is discouraged purely because it is outside the scope of the
>>transaction manager.
>>
>>It would be more accurate to say that file OUTPUT is discouraged. File
>>
> input
>
>>does not involves updates, and therefore cannot lead to update anomalies,
>>obviating the concern.
>>
>>Read files to your heart's content. Just don't WRITE them.
>>
>>
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user