Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


Give me simple example of hibernate caching and explain the
details of caching????? thanks in adv.



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

Post New Answer

More Advanced Java Interview Questions

What is chat area? Explain.

0 Answers  


What are the JSP implicit objects ?

1 Answers   eMids,


What are the methods used for inter-thread communication? and in what class these methods are defined?

2 Answers  


when we applied start()method on a thread ,how does it know that to execute run()method on that object?

2 Answers   HCL,


How do you download stubs from a Remote place?

1 Answers  


Describe activation process?

0 Answers  


Which textcomponent method is used to set a textcomponent to the read-only state?

0 Answers  


Does Java pass arguments by value or reference?

5 Answers   HeadStrong,


can a static method be overridden

41 Answers   IBM, SolutionNET,


What are the steps involved in developing an RMI object?

1 Answers  


How to do registration form using struts and hibernate?

1 Answers  


What invokes a thread?s run() method?

2 Answers  


Categories