Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How does "Entity Bean caching" work ?  RSS feed

 
Claudio Gualberto
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I'd like to know some details about how a application server caches its Entity Beans.
When i call an Entity Bean's home finder method
from any client, what exactly heapens on the server ? Does it search the line ( or lines ) on its cache, or it makes an database call every time ?
I would like to know what heapen on the server when a Entity Bean tries an SQL like this simple one:
SELECT SALARY from employee
WHERE <CONDITION>
supose the bean tries the following cases to <CONDITION> tag:
First query :
"SALARY > 1000 AND SALARY < 2000"
and later, i tries the second one:
"SALARY > 1000 AND SALARY < 2500"
At the second execution,will the application server query its EJB cache looking for lines that match the query ( in this case all lines that SALARY is between 1000 and 2000 are already in cache, they were stored there by the fisrt execution ) and ask the database only for the lines that is not in the cache yet , or the things dont work like this ??
Is the applications server cache system that smart ? Where to find info about it on the web ?
Thanks in advance.
Claudio Gualberto
 
Nitzan Levi
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
basicly as a developer it's not you concern how the server dose this kind of work , but what you do need to understand is that when you work with cashing it's importent that you don't access the DB directly it can cause inconsistency between the DB and the container.
when you choose to work with server cash then the container decides when to go to the DB and when to go to the cash in order to provide both data consistency and best perfomence. the server decides to save a bean in cash according to the emount of memory and the frequency of the bean use. i dont think that the server is making cashing for the finder methods but i think he dose it for the beans(the real instance of the bean).
if you want more vendore specific information you need to go the the vendors web site(for example ibm for websphere)
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!