This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Java Interview Guide and have Anthony DePalma on-line!
See this thread for details.
The moose likes EJB and other Java EE Technologies and the fly likes Is this a good idea Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Is this a good idea" Watch "Is this a good idea" New topic

Is this a good idea

Ransika deSilva
Ranch Hand

Joined: Feb 18, 2003
Posts: 524
Hi all,
I have a idea and want to get your opinion on this. My requirement is like this. There are users and they can select options which we provide and build up queries to generate reports. The tables have around 400,000 records (avarage) and it's growing every hour. So the problem is if I create the program to query the tables for each and every report and for many users, it takes ages to get the result as well as the server starts to crash. So my idea is to have some thing like this.
Develop Entity beans which will represent all the tables, I mean one bean for one table.What I want to achieve by this is to limit the DB access to 1 time for the enter server application (Full Dump) Then use instances of the beans as tables to get the results for users. My main idea is to reduce the number of accesses to the Database and reduce the memory over head in the Server. One more thing, I need periodic updates in the tables. I mean since new rows are adding frequently can I program the entity bean tp automatically get updates. Hope my idea is clear. So please be kind enough to give your ideas. Any alternative ideas are very well welcome.
Thank you very much....

SCJP 1.4, SCMAD 1.0<br />SCWCD, SCBCD (in progress)
Paul Sturrock

Joined: Apr 14, 2004
Posts: 10336

Reading a table of around 400000 records with Entity Beans is not a good idea. One of the many downsides of Entity Beans is they perform terribly with large result sets. You might like to have a look at the "JDBC For Reading" pattern.

I think you are suggesting using some sort of caching strategy to speed up performance - which is generally a good idea if your application can tolerate out of date data, which often web applications can. You might like to consider an ORM option then, since most persistance layers will also provide a caching mechanism (Hibernate e.g. has both the Session cache and the second level cache available).

JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Ransika deSilva
Ranch Hand

Joined: Feb 18, 2003
Posts: 524
Thanks a lot for the answer, now I know that even my plan was correct, the components which are was going to use were wrong, so I am trying to go for JDO or Hibernate concepts. Thanks a lot once again for the answer....
I agree. Here's the link:
subject: Is this a good idea
jQuery in Action, 3rd edition