Hibernate - Interview Questions and Answers for 'Cache' | Search Interview Question - javasearch.buggybread.com
Javasearch.buggybread.com

Search Interview Questions


 More than 3000 questions in repository.
 There are more than 900 unanswered questions.
Click here and help us by providing the answer.
 Have a video suggestion.
Click Correct / Improve and please let us know.
Label / Company      Label / Company / Text

   



Hibernate - Interview Questions and Answers for 'Cache' - 14 question(s) found - Order By Newest

Frequently asked question in companies using hibernate.
  Q1. Difference between first level and second level cache in hibernate ?Hibernate
Ans. 1. First level cache is enabled by default whereas Second level cache needs to be enabled explicitly.

2. First level Cache came with Hibernate 1.0 whereas Second level cache came with Hibernate 3.0.

3. First level Cache is Session specific whereas Second level cache is shared by sessions that is why First level cache is considered local and second level cache is considered global.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     hibernate   orm   hibernate cache   architecture   technical lead   first level cache vs second level cache     Asked in 18 Companies      Intermediate        frequent


 Q2. How to configure second level cache in Hibernate ?Hibernate
Ans. 1. Configure Provider class in Hibernate configuration file.

2. Add Cache usage tag ( read-only or read-write ) in mapping files ( hbm ).

3. Create an XML file called ehcache.xml and place in classpath which contains time settings and update settings, behavior of cache , lifetime and idletime of Pojos, how many objects are allowed.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     hibernate   orm   hibernate cache   architecture


 Q3. What are some differences between Spring caching and Hibernate caching?Hibernate
Ans. Spring caching makes use of its intercepting capabilities to add caching to method calls. Therefore, the entire object is cached and reused. Hibernate, on the other hand, has more domain-specific knowledge of the Entity being cached and can handle the objects more appropriately.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     spring framework   hibernate   spring cache   hibernate cache


 Q4. What is the use case for AWS Gateway cached , stored and VTL ? Amazon Web Services (AWS)
Ans. AWS Cached - Low Availability than AWS Stored, Lower cost than AWS Stored

AWS Stored - High Availability, High Local Storage Cost

AWS VTL - S3 Used as Back up only.


 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     aws gateway  aws gateway cached  aws gateway stored  aws gateway vtl


 Q5. What are the the methods to clear cache in Hibernate ?Hibernate
Ans. Evict() and clear(). Evist is used to clear a particular object from the cache whereas clear clears the complete local cache.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     hibernate   orm   hibernate cache


 Q6. What are different types of second level cache ?Hibernate
Ans. 1. EHCache ( Easy Hibernate )
2. OSCache ( Open Symphony )
3. Swarm Cache ( JBoss )
4. Tree Cache ( JBoss )

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     hibernate   orm   hibernate cache   technical lead     Asked in 7 Companies


 Q7. Can we disable first level cache ? What should one do if we don't want an object to be cached ?Hibernate
Ans. No.We can either call evict after the object retrieval or can use separate sessions.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     hibernate   orm   hibernate cache   architecture


 Q8. Have you ever faced any problem due to caching?
Ans. Yes , sometime we receive issues related to outdated pages being rendered to the user. In those cases we clear the cache and then try to investigate the reason for that. Sometime the issue is due to comparatively high refresh interval. In those cases we reduce the cache refresh interval.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     caching   cache   java   web applications   production support   application support


Frequently asked in high end product companies.
 Q9. Write code for LRU CacheCore Java
Ans. https://www.geeksforgeeks.org/lru-cache-implementation/

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     cache  LRU cache  coding  code     Asked in 10 Companies      intermediate


 Q10. What is dynacache and role of cachespec.xml in WCS ?IBM WCS
Ans. Dynacache in WCS is the object cache. Instead of creating objects again and again , the store objects are rendered on the basis of matched rules. Caching rules are stored in a configuration file called cachespec.xml.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     dynacache  cachespec.xml


 Q11. Can we see objects cached in Dynacache ?IBM WCS
Ans. We can see , monitor and can even change dynacache manually but for that we need to install a seperate application provided by WCS.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     Dynacache


 Q12. What is meant by "Locality of Reference" or "Cache Locality" ?Core Java
 This question is still unanswered. Can you please provide an answer.


 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     Cache Locality  Locality of Reference


 Q13. Which data structure would you use to implement LRU cache and Why ? Can you tell me the time complexity for it ?Algorithm
Ans. We can use LinkedHashMap as it will give time complexity of O(1) for lookup and We can maintain the insertion order to identify the Last used elements for eviction.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     LRU Cache     Asked in 1 Companies


 Q14. Do you know how can we export Redis data ?Redis
 This question is still unanswered. Can you please provide an answer.


 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     Amazon Web Services (AWS)  Redis  Memcache


 Q15. Which of the following is not true for Hibernate Cache ?Hibernate
a. First level cache is enabled by default
b. First level Cache is Session specific
c. First level cache is considered global
d. First level Cache came with Hibernate 1.0

Ans.c. First level cache is considered global


Help us and Others Improve. Please let us know the questions asked in any of your previous interview.

Any input from you will be highly appreciated and It will unlock the application for 10 more requests.

Company Name:
Questions Asked: