Glassfish中可以有一个干净的undesploy吗? [英] Is is possible to have a clean undeploy in Glassfish?

查看:157
本文介绍了Glassfish中可以有一个干净的undesploy吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我意识到任何使用hibernate的应用程序都无法在Glassfish 2.1.1中完全取消部署。在取消部署过程后,许多类仍保留在内存中,您可以使用jmap和jhat检查它。

我已经做了几次测试,发现只有有休眠的应用程序才能执行clen undeploy进程。我所有的Hibernate数据库提供者都是jTDS 1.2.5。

如果您只是部署并立即取消部署,您将在内存中实现几个类,其中许多来自您的应用程序,许多来自Hibernate及其依赖项。

Glassfish v2.1.1中可以有一个干净的undeploy吗?

解决方案

这不是一个确定的答案,但它至少可以最小化glassfish相关的undeployement问题,如果您使用hibernate:


  • 不要在您的实体中使用枚举。创建常规类。

  • 仅注释方法,不注释属性。



这些两个项目可以帮助最大限度地减少问题,但不要让他们摆脱你的开发环境。即使你不使用hibernate,即使在未部署之后,你的sesion bean也会永远留在内存中。


I realized that any application which uses hibernate, fails to undeploy completely in Glassfish 2.1.1. Many classes remain in memory after the undeployment process, you can check it using jmap and jhat.

I've done several tests, and figured out that only applications which had hibernate failed to have a clen undeploy process. My Database provider for Hibernate in all the cases were jTDS 1.2.5.

You don't even need to run the application. If you just deploy, and instantly undeploy, you will realize several classes in memory, many from your application and many from hibernate and its dependencies.

Is it possible to have a clean undeploy in Glassfish v2.1.1? I'm running out of permgen space all the time.

解决方案

This is not a definitive answer, but it can at least minimize glassfish related undeployement issues, if you are using hibernate:

  • Don't use enums in your entities. Create regular classes instead.
  • Annotate only methods, don't annotate properties.

These two items can help minimizing problems, but don't get them rid of your development environment. Even if you don't use hibernate, your sesion beans stay forever in memory even after undeployement.

这篇关于Glassfish中可以有一个干净的undesploy吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆