|
| Index | Recent Threads | Unanswered Threads | List Polls | Public Albums | Who's Online | Help |
|
|
| No member browsing this thread |
|
Thread Status: Active Total posts in this thread: 9 |
|
| Author |
|
|
Stranger Joined: Apr 24, 2006 Post Count: 6 Status: Offline |
Hi All, I am contemplating to write as below but have doubts. All changes are reflected only in the application. Application(values) is only written back to database when it is closed. Pls. advise. Thank you. |
||
|
|
mvnForum Developer Vietnam Joined: Oct 16, 2002 Post Count: 2956 Status: Offline |
Yes, I think you can do it this way, and what is your problem that you cannot solved? ---------------------------------------- Minh Nguyen mvnForum Developer Want a free, open source Java Jsp/Servlet forum, get mvnForum at http://www.mvnForum.com http://www.DienDanLinux.org |
||
|
|
Stranger Joined: Apr 24, 2006 Post Count: 6 Status: Offline |
Did not encounter any problem with this(so far). Only not sure if this is a good idea. I thought it would lead to performance gain if there is not much database calls involved in an application. Is this true? |
||
|
|
mvnForum developer Vietnam Joined: Sep 16, 2004 Post Count: 85 Status: Offline |
Did not encounter any problem with this(so far). Only not sure if this is a good idea. I thought it would lead to performance gain if there is not much database calls involved in an application. Is this true? I'm not sure I understand what you thought. However, init & destroy, each of them is called 1 times exactly by servlet container in your application, i don't think there are performance problems here.. ![]() |
||
|
|
Stranger Joined: Apr 24, 2006 Post Count: 6 Status: Offline |
Let me try to clarify. I come to this idea as I do not want to make many database calls. However, I am not sure if it is a good idea. EntryServlet would retrieve all tables from the database & build the application & store in ServletContext in init(). Subsequent changes would only reflect in the application(not written to database). The application would only be written back to database in destroy(). So my question is, would it be more efficient if I write application in this manner? Secondly, is this a good practice? |
||
|
|
mvnForum developer Vietnam Joined: Sep 16, 2004 Post Count: 85 Status: Offline |
Let me try to clarify. I come to this idea as I do not want to make many database calls. However, I am not sure if it is a good idea. EntryServlet would retrieve all tables from the database & build the application & store in ServletContext in init(). Subsequent changes would only reflect in the application(not written to database). The application would only be written back to database in destroy(). So my question is, would it be more efficient if I write application in this manner? Secondly, is this a good practice? It sound simirlar to "caching" Let me give some my ideas, - What happen if your application is crashed suddently. Because no time for server save all new memories-data back. - System will be slow down because of have to remember data anytimes - Server memories can not stand for a long time when the new data is added increasingly. However, If you want to apply caching, you should consider system & application. you should applied this strategy for Configurable Data: username, password, row_per_page... which saving back is not important. This is the way most applications apply. ![]() |
||
|
|
Stranger Joined: Apr 24, 2006 Post Count: 6 Status: Offline |
Thank you for the caution and suggestion. Will heed your advise. System will be slow down because of have to remember data anytimes Funny.. it is actually faster than other application which have to retrieve data from database. Is this because it is relatively small & therefore system could accomodate it well? |
||
|
|
mvnForum developer Vietnam Joined: Sep 16, 2004 Post Count: 85 Status: Offline |
Thank you for the caution and suggestion. Will heed your advise. System will be slow down because of have to remember data anytimes Funny.. it is actually faster than other application which have to retrieve data from database. Is this because it is relatively small & therefore system could accomodate it well? Yes, that is what i thought. We can imagine that. In your desktop, some background application (relatively small) can run with no sense but what happen when you open a Java IDE.. eclipse.. (big application) your pc get slow down clearly.. However, there is no any big problem when you open a browser to a website (Connect occasionally).. ![]() |
||
|
|
Stranger Joined: Apr 24, 2006 Post Count: 6 Status: Offline |
Appreciate your response. It is helpful. Thank you. |
||
|
|
|
|
|
Current timezone is GMT Jan 7, 2009 4:31:50 PM |



However, there is no any big problem when you open a browser to a website (Connect occasionally)..