3 Replies Latest reply on Oct 10, 2003 10:11 PM by amol

    Entity Bean Instance pooling

      Hello ,

      I have one sample "Student" Entity Bean(CMP) example which demonstrates the the Jboss Application server do not use any instance pooling.
      It Creates a new Instance every time , I send a request to it.

      My example first added 20,000 rows in Student table with schema (id,firstname,lastname,address).

      the row is (id++,'test','test','test') with id start with 0.

      I inserted this row using StudentHome.create(StudentValueObject) 20,000 times in a for loop.
      Each time I iterate through this loop , container creates a new Instance of StudentEntityBean. I watched this by Putting Sys.out.println inside no argument constructor of my StudentBean.


      It takes around 30 mins to add 20,000 rows on a machine with 256MB RAM.

      One more thing , when i use findByName('test') , it returns me a collection of StudentRemote Objects of size 20,000 ;

      Againg when I iterate through this collection to print the student (fname.lname,address) , it creates the new Instance of StudentBean for each iteration.

      I think this demonstrates that JBoss do not use any instance pooling , it simply creates new entity bean instance every time.

      Regards,