1 Reply Latest reply on Aug 28, 2003 10:53 PM by wmprice

    Test the Home Validity - avoid NullPointerException

    noel.rocher

      Hi,

      Is there a way to test the validity of a home of a stateless session bean other than to invoke the create method ?

      When I put a handle of such an object in a http session, I want to detect if I can reuse it or if i need a new valid one.

      Tx,

      Noel

        • 1. Re: Test the Home Validity - avoid NullPointerException

          Hello,
          In terms of a stateless session bean you should be ok regardless. If kept in session, the object should remain valid. However, I trust what you are trying not to do is serialzie the javax.ejb.Handle, and then recreate the reference at some later point. Of course you can always do:

          if(ejbReference == null)
          //Create new reference here

          else
          proceed

          If I have missed something in your problem let me know.

          Regards,

          Weston