想知道在可靠性方面选择Redhat还是Windows 2003 Server是否重要? 假设两者的技能水平相等。 谢谢
想知道在可靠性方面选择Redhat还是Windows 2003 Server是否重要? 假设两者的技能水平相等。 谢谢
如果你查看glassfish的源代码,特别是./appserv-commons/src/java/com/sun/enterprise/util/io/FileUtils.java文件,你会看到Glassfish为了删除/重命名Windows上的文件和目录而进行的所有曲折操作。
这是一个Windows问题,由于其限制打开文件的删除和重命名。
其中有各种技巧,包括多次请求JVM释放文件流以关闭文件,"伪"重命名和睡眠-尝试循环。
以下是一些示例:
/**
*Attempts to delete files that could not be deleted earlier and were not overwritten.
*<p>
*On Windows, the method requests garbage collection which may unlock locked
*files. (The JarFile finalizer closes the file.)
/*
*On Windows, as long as not all leftover files have been cleaned and we have not
*run the max. number of retries, try again to trigger gc and delete
*each remaining leftover file.
*/
/**
* Windows has BIG issues renaming a directory that is open somnewhere -- e.g. if
* a DOS box is opened anywhere in that directory.
* This method will try to do a "virtual renaming" if there are problems
* I.e. it attempts to do a simple rename, if that fails it will copy everything under
* the original directory to the renamed directory. Then it will delete everything
* under the original directory that the OS will allow it to.
在实践中,这有时会导致在Windows上出现损坏的部署或重新部署,因为某些文件无法被删除或移动,最终会被留下。在我运行的大约50个Glassfish实例中,我从未在Solaris 10上遇到过问题,但在Windows上总是出现与此相关的问题。