[jbossws-issues] [JBoss JIRA] Commented: (JBWS-1849) Provide API to clean up MTOM attachments

Wolfgang Buckel (JIRA) jira-events at lists.jboss.org
Thu Oct 11 07:54:03 EDT 2007


    [ http://jira.jboss.com/jira/browse/JBWS-1849?page=comments#action_12381651 ] 
            
Wolfgang Buckel commented on JBWS-1849:
---------------------------------------

Richard,

I don't find your comment particularily helpful. I also don't want to start an "OS war" discussion here. If we can't agree on the OS we hopefully can agree that behavior should be identical on both (see http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4205562).

My problem here isn't as much that the files are not cleaned up after shutting down JBoss. The idea is the JBoss runs 24x7 right? The problem is that during runtime the files are not always cleaned up. Also we have JBossWS-clients that themselves run in servers expected to operate 24x7 and requiring no shut down for cleanup.

The reasons for failure to cleanup I suspect in several areas:
1. Closing an InputStream (in a finally clause) is absolutely mandatory here. To me this seems not always to be the case inside the JBossWS stack (especially on client side).
2. On the the server-side things got a lot better after I closed the InputStream obtained from DataHandler. However, It still happens that files don't get deleted. I suspect this is because SwapableMemoryDataSource relies on finalize to be called for cleanup. Either this does not always happen or something else keeps the swapFile.delete() call from working.

As a temporary workaround I wrote a periodical cleanup thread inside JBoss attempting to delete the files. However, some files are really locked (by far not all of them), so that delete returns false. Such a file also cannot be deleted from the outside and (SysInternals) ProcessExplorer shows that java.exe is holding an open handle on the file.

Since implementers of an MTOM web service really know when they are done with a passed in DataHandler this would be the ideal place to call some method closing and deleting the file. The holds true for MTOM web service clients.

> Provide API to clean up MTOM attachments
> ----------------------------------------
>
>                 Key: JBWS-1849
>                 URL: http://jira.jboss.com/jira/browse/JBWS-1849
>             Project: JBoss Web Services
>          Issue Type: Feature Request
>      Security Level: Public(Everyone can see) 
>          Components: jbossws-jaxrpc, jbossws-jaxws
>    Affects Versions: jbossws-1.2.0.SP1
>         Environment: Windows
>            Reporter: Magesh Kumar B
>            Priority: Optional
>
> When using MTOM with attachments, the temp files created using SwapableMemoryDataSource are not deleted in Windows environment. This is due to a problem in Windows and an outstanding bug in Java too contributes to it. 
> http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4171239
> It would be nice to have an API that can be explicity called to delete these temp files created as part of MTOM requests.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the jbossws-issues mailing list