In client side there is a block which invoke the remove() method to destory the stateful session bean.
But if the network is unavailable before the remove() is invoked, what should we do to destory that stateful seesion bean to release the resources it has occupied in order to not cause memory leak?Thanks for your reply....

解决方案 »

  1.   

    就是说:对于有状态会话bean,在客户端我们会写一个remove()去销毁这个bean来释放他所占用的资源。但是如果在客户端执行remove()之前,网络断掉了,那么为了收回资源,防止内存泄漏,有什么方法可以让jboss在服务器端自动销毁这个session bean?
      

  2.   

    session.remove();session.invalidate();
      

  3.   

    首先jboss如何得知网络断掉这种异常呢?
      

  4.   

    做了实验,发现jboss根本捕获不到网络断掉的异常
      

  5.   

    楼主能不能设置失效时间,让系统发送请求给连接,如果没有反应,就remove。
      

  6.   

    这是不是违背了ejb的初衷?回复8楼:不知道去哪里设置这个实效时间
    jboss中的standardjboss.xml的那个30分钟的设置没看出起到什么作用,30分钟後,服务器并没有remove()那个session bean因为资源没有被释放,内存还是被占用着。jboss-service.xml中也只是设置transaction的实效时间这个应该是和数据库的交互时间吧,服务器在时间到期之后并没有remove()。
    另外,还有这个remove()在服务器端可以自己调用吗?
      

  7.   

    just as i said to you at the other replay with chinese ....
      

  8.   

    session.remove();session.invalidate();