1 Reply Latest reply on Mar 4, 2010 8:04 AM by Harut Sargsyan

    Putting Beans into a SessionBean, not able to retrive the latest information with is modifed by another user.

    ajaykumar kadiyala Novice

      Scenario.
      1) Face-config.xml
      <managed-bean>
        <description>locationBean</description>
        <managed-bean-name>locationBean</managed-bean-name>
        <managed-bean-class>com.test.lbs.presentation.examples.LocationBean</managed-bean-class>
        <managed-bean-scope>session</managed-bean-scope>
      </managed-bean>


      2) LocationBean.java

      public class LocationBean
      {
      private List<LocationVO> listOfLocation;
      public LocationBean()
      {
      if(listOfLocation==null)
        {
        listOfLocation=getALLLocationData();
        //Loading the location Data
        }
      }
      public List<LocationBean getALLLocationData(){
        //call to db
      }

      public  List<LocationVO> getListOfLocation()
      {
      return(listOfLocation);
      }

      public  void  setListOfLocation(List<LocationVO> aLocationVO)
      {
      listOfLocation.aLocationVO;
      }

      }

      3) Location.xthml

      <rich:datatable value={locationBean.listOfLocation} var="dataItems" ...bla bla>

      <rich:column>
      <h:outputText value={dataItems.country} />
      </rich:column>
      </rich:datatable>

      Scenario.
      Case1) Login Time :1:00 PM ,Logged Out Time=1:10 PM
      Assesing USER 1
      1) Assuming there only 8 record are avaible in DB,the service getALLLocationData() is retriving same number of record and displayed in GUI using  help of <rich:datatable..>.

      Case2) Login Time :1:05 PM  Logged Out Time=1:08 PM
      Assesing USER 2
      1) The user 2 is added 2 records .

      Problem : USER 1 is not able to see the remaing 2 records.Pleas suggest to me .