the service \"pub.file.getFile\" is not safe!!!!

Hi folks,

Appearently if the “stream” option is used , the “InputStream” created by this service is not closed automatically , I may look fine under normal situations but will throw " too many open files" exception under load.

“too many open files” might be also thrown because of the restrictions of the OS ( in our specific case , UNIX ) for example number of file descriptors, or as webMethods states “because of POOR JAVA PROGRAMMING …”, e.g.( creating an implicit Input/outputStream , that can not be later closed).

http://advantage.webmethods.com/article/?id=1611974969

For what regards this specific service “pub.file.getFile”, wm suggests to develop a custom java code that closes the stream. and call that service after every call of the getFile.

Finally , maybe webMethods should also consider some good library design patterns.

Any comments??

have fun

Masoud,

If you use getFile with the stream option you should close the stream when finished processing. You can find an example of a closeStream service in the PSUtilities package available on Advantage [PSUtilities.stream:closeStream]. If you don’t use the closeStream service the file handle will be closed at the next GC run.

James…