Peter Donald wrote:
>
> Hi,
>
> hmmmm - I though I deleted this bug in Avalon. So I went had a look at
> James source and there is also a bug there aswell. The specific file it is
> in is AvalonMailRepository.java. In the function
>
> public synchronized MailImpl retrieve(String key) {
> MailImpl mc = (MailImpl) or.get(key);
> try {
> mc.setMessage(sr.get(key));
> } catch (Exception me) {
> throw new RuntimeException("Exception while retrieving mail: "
> + me.getMessage());
> }
> return mc;
> }
>
> sr.get(key) returns an InputStream but nowhere is it closed. Someone should
> change this to something like
>
> InputStream ins = sr.get(key)
> mc.setMessage( ins );
> ins.close();
Alas, I tried that in response to Stuart's bug report - but it just
broke other stuff.
I think we will need to revisit MailImpl so that it doesn't try to
carry streams (and therefore, potentially, filehandles) around.
I'll have another look today.
Charles
> This may remove the bug. Look for other instances of similar behaviour in
> James to get the rest of the bugs like this. Essentially as InputStream is
> never explicilty closed it may for somereason in some VMs remain dorment
> and not GCed and finalized. This of course means that the files can not be
> deleted on win32 due to file being still open.
>
> Cheers,
>
> Pete
>
> *------------------------------------------------------*
> | Despite your efforts to be a romantic hero, you will |
> | gradually evolve into a postmodern plot device. |
> *------------------------------------------------------*
>
> ------------------------------------------------------------
> To subscribe: [EMAIL PROTECTED]
> To unsubscribe: [EMAIL PROTECTED]
> Archives: <http://www.mail-archive.com/james%40list.working-dogs.com/>
> Problems?: [EMAIL PROTECTED]
------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Archives: <http://www.mail-archive.com/james%40list.working-dogs.com/>
Problems?: [EMAIL PROTECTED]