can anybody tell me how can i store the results form a DB on the webtier..so that i can minimize the overlaod on the DB.Assume the request to the DB is specific. and let me know how the webtier gets updated when the DB gets changed. i am supposed to use j2ee and the DB cane be either DB2 or ORACLE
thanks in advance.. gopikrishna.
-
caching the results in webtier (2 messages)
- Posted by: gopinath kothamasu
- Posted on: February 16 2005 04:03 EST
Threaded Messages (2)
- caching the results in webtier by Santiago Caama??o on February 16 2005 07:07 EST
- caching the results in webtier by adrian osullivan on February 16 2005 07:34 EST
-
caching the results in webtier[ Go to top ]
- Posted by: Santiago Caama??o
- Posted on: February 16 2005 07:07 EST
- in response to gopinath kothamasu
You can use the RowSet class, basically it works like a ResulSet, but you can store it, for a later use.
i remenber, that i download an implemantation of a RowSet two years ago from java.sun.com/jdbc. -
caching the results in webtier[ Go to top ]
- Posted by: adrian osullivan
- Posted on: February 16 2005 07:34 EST
- in response to gopinath kothamasu
You can use any object you like to store the data - but its bad design to pass jdbc objects such as a RowSet out of the data tier.
Caching in the webtier can be done easily in the session scope using the Session object, but you probably want a global cache. This is a ubiquitous problem in j2ee.
Options include:
singleton design pattern: but this does not work in a cluster as singletons are usually implemented per jvm
custom rmi cache: rmi application serving bound to the global jndi tree in the j2ee server, or bound to an external jndi tree
3rd party cache solution: e.g. Oracle Objectcache or Tangosol
See also read-mostly ejb pattern for a reasonable solution.