GlassFish在Windows上与RedHat上的区别

11

想知道在可靠性方面选择Redhat还是Windows 2003 Server是否重要? 假设两者的技能水平相等。 谢谢

2个回答

17

如果你查看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上总是出现与此相关的问题。
简而言之,仅基于这个原因,任何*NIX都会更好,除了其他平台管理考虑因素。

3
我认为大多数人会认为Redhat比Windows更可靠。 Glassfish本身在两者上应该都能运行。
你应该在Server Fault上提出这个问题。

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接