Entity bean quistions


EJB programming & troubleshooting: Entity bean quistions

  1. Entity bean quistions (2 messages)

       I am so sorry for intruding this way ,but I had an urgent couple of quistion regarding EJB I hoped you would answer me for them- I have tried to post it on EJB forum but could not do it- :

    1) how can we keep a long refrance to Entity bean that is I want to keep MY entity for more than one invocation into several intervals ,do i always have to look it up ( find it!).

    2)is I am using a atatefull session bean and there is a servelet using id how the session id for the Session be will be kept across severa; invocations.

    Please I would be so sppraciative if you could answer these quistions for me,and sorry again for the trouble

    Threaded Messages (2)

  2. Entity bean quistions[ Go to top ]

    I'm not sure if I understand your questions correctly, but I'll try to answer them:

    1) Simply keep a referene (in Java terms) to it... you won't need to look it up. If you need a reference to it through activation/passivation or even load/store use a handle (EJBObject.getHandle()). This is serializable and can be used for long term references. The problem is that not all appservers handle handles very efficiently (but Borland AppServer does *gg*)

    2) I'm not sure what you mean by this. However, a stateful session bean can simply have attributes which are kept across calls from a client.

    if you have other questions or my answers were not what you expected please tell me.


  3. Entity bean quistions[ Go to top ]

    thank you for answering both quistions,for the first one i think I will keep a refrance ,for the second one I have ment that,if i have a facade session bean (stateless),it does not preserve state , so how could the client from the client side(Swing or WEb) keep refrance to its statfull sesion bean.

    Omar abu-jiab