Give me simple example of hibernate caching and explain the
details of caching????? thanks in adv.
Answer / imambasha
caching concept in hibernate is performed internally in
stages...
1)firstlevel(Session) caching
2)Secondlevel(SessionFactory) caching
1)firstlevel(Session) caching:
First-level cache always Associates with the Session
object. Hibernate uses this cache by default. Here, it
processes one transaction after another one, means wont
process one transaction many times. Mainly it reduces the
number of SQL queries it needs to generate within a given
transaction. That is instead of updating after every
modification done in the transaction, it updates the
transaction only at the end of the transaction.
2)Secondlevel(SessionFactory) caching
Second-level cache always associates with the Session
Factory object. While running the transactions, in between
it loads the objects at the Session Factory level, so that
those objects will available to the entire application,
don’t bounds to single user. Since the objects are already
loaded in the cache, whenever an object is returned by the
query, at that time no need to go for a database
transaction. In this way the second level cache works.
| Is This Answer Correct ? | 11 Yes | 2 No |
Explain how will the struts know which action class to call when you submit a form?
int x=5,i=1,y=0; while(i<=5) { y=x++ + ++x; i=i+2; } System.out.println(x); System.out.println(y); System.out.println(i); How to solve this? Please explain!
What is an abstract method?
Why RMI required an interface?
Why are some of the class and element names counter-intuitive?
What restrictions are placed on the location of a package statement within a source code file?
Explain the different types of memory used by jvm?
What is the use of Semaphore?
What is the purpose of the wait(), notify(), and notifyall() methods?
Can you write Java code for declaration of multiple inheritance in Java ?
difference between applicationserver and webserver
What is prototype?