What happens to the beans?
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   iain_sanderson
Posted On:   Thursday, June 27, 2002 10:31 AM

My struts web application is progressing nicely. Its a simple MVC implementation of a clinical database with web pages that show patient data securely. I've had a quick and dirty version working for some time using JSPs and scriptlets, and now have seen the light and am using Struts. Of course, I have to completely rewrite all my code and wrap my head around some real Java programming ( You can go a long way with scriptlets and JSP without really understanding Java and OOP.) My main hurdle has been the Model.I can't create an Object-relational model that reflects all 100 tables in my database, but am able to create row level beans that reflect rows from the resultSets derived from complex queries applied to the database.    More>>

My struts web application is progressing nicely. Its a simple MVC implementation of a clinical database with web pages that show patient data securely. I've had a quick and dirty version working for some time using JSPs and scriptlets, and now have seen the light and am using Struts.


Of course, I have to completely rewrite all my code and wrap my head around some real Java programming ( You can go a long way with scriptlets and JSP without really understanding Java and OOP.)


My main hurdle has been the Model.I can't create an Object-relational model that reflects all 100 tables in my database, but am able to create row level beans that reflect rows from the resultSets derived from complex queries applied to the database. I use Getter and Setter methods to instantiate properties in these Beans, which I package up into a Vector and add to the request attribute of a Struts ActionForm. The View JSP unpacks the Vector and writes out the bean properties as data on the JSP. I think I have managed a separation of business logic from the application's presentation logic using these helper classes. I am using Poolman for connection pooling as I can't find anything else that has query caching.


I've timed my non-struts application and the STRUTS verson, but the queries I ran were not directly comparable - they were about the same-18 seconds/request for a vast amount of data, which is accepable in our environment.


Here's my question - eventually - My program creates over 100 beans per request, and in volume use presumably there will be a flux of thousands of beans per second. What happens to them? Are they cleaned up automatically at the end of each request? I noticed that by inspecting the name of beans in the request attribute (using Netbeans' HTTP monitor) that some names were reappearing in subsequest identical requests if I refreshed a page. I don't have any "destroy" or "kill" methods - do I need to implement these? Is my application going to bog down in garbage?


Any advice gratefully received.


Iain.

   <<Less

Re: What happens to the beans?

Posted By:   David_Mann  
Posted On:   Friday, July 5, 2002 05:15 AM

Hello Iain,


depends on the container (AppServer), huh? IIRC Bean Instances are being cached. You can fine-tune this stuff, though.


HTH
David
About | Sitemap | Contact