Hi all,
I plan to use session beans as front-ends to load and store objects from and to a RDMBS. Basically, instead of using session beans to wrap entity beans, I would like to use session beans to wrap "database" objects.
What is the recommended way to cache the loaded objects? For load operations, I would like to hit the database server as rarely as possible.
I do not plan to use entity beans.
Thanks,
Anh
-
EJB Caching Issues (9 messages)
- Posted by: Phan Anh Tran
- Posted on: October 25 2000 03:02 EDT
Threaded Messages (9)
- EJB Caching Issues by Dimitri Rakitine on October 25 2000 03:24 EDT
- EJB Caching Issues by Andy Liu on October 25 2000 16:43 EDT
- EJB Caching Issues by Phan Anh Tran on October 25 2000 22:24 EDT
- EJB Caching Issues by John Yost on October 26 2000 03:26 EDT
- EJB Caching Issues by Lalitha Sundaram on December 23 2000 06:57 EST
- EJB Caching Issues by andrew kelly on October 30 2000 13:11 EST
- EJB Caching Issues by Scot Bellamy on November 01 2000 10:59 EST
- EJB Caching Issues by Deepak Nautiyal on November 16 2000 17:14 EST
- EJB Caching Issues by Steve Snodgrass on December 14 2000 11:34 EST
-
EJB Caching Issues[ Go to top ]
- Posted by: Dimitri Rakitine
- Posted on: October 25 2000 03:24 EDT
- in response to Phan Anh Tran
Why not use Entity Beans? (unless your caching schema is drmatically different from what is being offered by your EJB container - in which case you probably do not need session beans or EJB container - just implement your caching logic and database accesses yourself). -
EJB Caching Issues[ Go to top ]
- Posted by: Andy Liu
- Posted on: October 25 2000 16:43 EDT
- in response to Dimitri Rakitine
To me, the overhead of entity bean is too heavy that even after we do some optimization like using session bean to wrap the entity bean and use isModified() method(in weblogic) to limit the database calls, we still get too many accesses to the DB. Using a session bean with proper caching seems to be a little bit difficult to program but we only make DB calls when it's necessary. Anybody can have some idea that how can we get rid of excessive DB access when using entity bean? -
EJB Caching Issues[ Go to top ]
- Posted by: Phan Anh Tran
- Posted on: October 25 2000 22:24 EDT
- in response to Dimitri Rakitine
Well, Entity beans are a pain to use and quite inefficient because more often than not, they hit the database server more than necessary.
-
EJB Caching Issues[ Go to top ]
- Posted by: John Yost
- Posted on: October 26 2000 15:26 EDT
- in response to Phan Anh Tran
Anh,
Did you specify the level of transaction isolation? The number of times that an entity accesses the database, specifically that the ejbStore() method is invoked, is a function of the transaction isolation parameter. -
EJB Caching Issues[ Go to top ]
- Posted by: Lalitha Sundaram
- Posted on: December 23 2000 18:57 EST
- in response to Phan Anh Tran
hi phan....
Use of Entity Beans and Stateful Session Beans does cause unwanted overhead. To what extent will this affect performance. Also while a combination of stateless session bean and http session can be a substitute to Stateful Session Beans... When do we actually go in for a stateful session bean?
regds
lalitha
-
EJB Caching Issues[ Go to top ]
- Posted by: andrew kelly
- Posted on: October 30 2000 13:11 EST
- in response to Phan Anh Tran
This is exactly what we do, however we use weblogic startup classes to create a singleton object within the appserver that then runs mutiple threads to sevice request for data. If you don't like this then the otehr approach is to RMI or CORBA out to a server outside the appserver. However you then have the overhead of a remote call.
This design is used extensively and works very well, the only problem is if your cache hits more than the 1Gb size, you then run into problems with the GC cycles being too long and effecting clients connected to the app server as they time out.
Bye -
EJB Caching Issues[ Go to top ]
- Posted by: Scot Bellamy
- Posted on: November 01 2000 10:59 EST
- in response to andrew kelly
If the database is not being used outside of your application, you can set dbIsShared to false. This will prevent ejbLoad() from being called on every call to a remote interface method.
Scot. -
EJB Caching Issues[ Go to top ]
- Posted by: Deepak Nautiyal
- Posted on: November 16 2000 17:14 EST
- in response to andrew kelly
Andrew,
I read your response to the "EJB Caching issue" with great interest. Can you tell me how one can use "weblogic startup classes to create a singleton object". I will appreciate if you could show me the code/steps that it takes to set up this singleton object. I am not very familiar with weblogic server.
Best regards,
Deepak Nautiyal -
EJB Caching Issues[ Go to top ]
- Posted by: Steve Snodgrass
- Posted on: December 14 2000 11:34 EST
- in response to Deepak Nautiyal
I too am running Weblogic (5.1) and am using a startup class to create a Singleton object that acts as a data cache. It is really quite simple. Weblogic provides for a mechanism so that classes which are specified as startup classes in the properties file will be run upon server startup. In our case, this class performs some database queries and parses the ResultSet into a series of custom classes. These classes are then bound to the context via JNDI. The application then retrieves by calling a method in a stateless session bean which does the appropriate JNDI lookup. Seems to work great but I do have one question.
A previous reply to this thread mentioned an issue where if the cache exceeds 1 GB, server performance will suffer. Our cache is no where near that size but I could imagine it growing to 50-100 MBytes. When the objects are bound, are they serialized and written to disk? I have conducted some preliminary tests on our app and it appears to me that our cache is stored in RAM and not on disk. I ask this because I can't imagine a server which can stand to tie up 1 Gig of RAM to store a cache. (Maybe we just have whimpy servers where I work.)
Thanks,
Steve