0 Replies Latest reply on Jul 26, 2007 2:43 AM by tomas kral

    Stafull session bewn - set new reference

    tomas kral Newbie

      I have a question:

      I have statefull bean:

      public class HotelSearch implements HotelSearchLocalIF {
       private Hotel hotel;
       private List<Hotel> hotelList;
       * Set new hotel.
       public void setHotel(Hotel hotel) {
       this.hotel = hotel;
       private void logHotel() {

      I call
      from another stateless bean to set new detail.

      Then I call
      but there is original hotel logged
      (which was in variable hotel before setting new one).
      It looks like method
      sets new detail only for
      method duration. But after this method ends, original hotel is injected.

      When I want to change hotel, I have to change attributes of hotel, but not whole instance (reference):

      public void setHotel(Hotel hotel) {
      // this.hotel = hotel; //not works, after methodends, there is original hotel injected
       //ne approach to update hotel detail

      Can I force HotelSearch to set new hotel reference for HotelSearch?

      I have met this several times and I don't now the right solution.

      I have tried the same with @In and behaviour is similar.