I want to store a reference to a Stateful Session Bean and save it to the database or transfer it to another VM. As far as I read, in EJB 2.x this is possible using getHandle()
.
If I try to serialize the SFSB instance using Glassfish 3.1.1, I get the following exception:
java.io.NotSerializableException: com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate
此外,我还没有找到获得SFSB处理器的方法。 SFSB会话中所有关于EFBHome、EFBBbject、EFBClobalHome的引用都无效,即使该豆子由容器妥善管理。 如果我正确理解,不管怎样,EJB 3.1中也没有必要处理,因为开发商应该能够直接使用SFSB的引用。
处理同一问题,但建议使用JavaEEObjectInputStream 类方法并未在我的测试中暴露出该方法的读目标。 我想知道该方法如何运作。
有没有人能建议一种把玻璃鱼的SFSB序列起来的好方法来保存参考文献? 我不想把参考文献附在HTTP会议上(我这样说是因为人们建议到处这样做)。