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.

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

Difference between new operator and class.forname().newinstance()?

1179


How would you create a button with rounded edges?

1239


which type of objects reference will be given to client?

2521


Why doesn’t the focus feature on the tag work in every circumstance?

1171


What is prototype?

1258


Name three subclasses of the component class?

1159


What’s jboss cache in short?

1183


Why does the tag url-encode javascript and mailto links?

1069


What happens when a thread cannot acquire a lock on an object?

1087


AS a developer will u create a data source in connection pool? If so how will u do that, how to access the object from connection pool using IRAD tool?

2199


What is the difference between the string and stringbuffer classes?

1161


difference between  ejb,struts,hibernate,spring and jsp

2922


Can I run seam outside of jboss as?

1112


Why is actionform a base class rather than an interface?

1115


Which component handles cluster communication in jboss?

1163