我試圖確定使用EJB3 Singleton會話bean與HashMap或者在實體上使用第二級緩存和@Cacheable註解來緩存哪種方法更好。EJB3 Singleton with HashMap vs JPA 2nd Level @Cacheable on Entity
0
A
回答
0
不知道你是什麼意思的單身SessionBean,但它聽起來不太好。使用@Cacheable。
+0
嗨,James,您可以使用EJB3 Singleton會話bean並添加一個HashMap作爲緩存,並且容器併發性管理將處理同步。所以基本上,通過在Singleton中添加一個HashMap,它就像二級緩存。所以對於我的問題,我是否真的需要在JPA的實體級別執行@Cacheable以獲得二級緩存,或者只需在Singleton會話Bean中使用HashMap作爲緩存。謝謝 –
相關問題
- 1. EJB3 Singleton Session Bean和ConcurrentHashMap
- 2. @Cacheable with Spring 3.1
- 3. Ordering on Type Level Naturals
- 4. EJB3 with Spring
- 5. EJB3/JPA @Transactional
- 6. EJB3沒有JPA
- 7. Singleton w/HashMap
- 8. Angularjs Ng-repeat with search filter only only on 2nd character keyup
- 9. Spring Data Redis NullPointerException with @Cacheable
- 10. Singleton with multiserver
- 11. Singleton with Activator.CreateInstance
- 12. jsp:useBean with Simple Singleton
- 13. Multtonreading with Singleton
- 14. JPA - EmbeddedId with @ManytoOne
- 15. Singleton EJB,JPA併發訪問
- 16. GetUTCDate with Entity Framework
- 17. Muti level domain with Facebook App
- 18. @ElementCollection with Map <Entity,Embeddable>其中Entity是Embeddable的字段
- 19. Android Version VS API level
- 20. Singleton with Java multithreading app
- 21. Spring bean singleton vs singleton pattern
- 22. 匕首2 Singleton vs Real Singleton
- 23. JPA annotations = EJB3 annotations = Hibernate annotations?
- 24. 使用Hibernate 2nd Level Cache和HSQL令人失望的插入/更新率
- 25. PreparedStatement with hashmap
- 26. Java XStream with HashMap
- 27. NoSQL with Entity Framework 5.0
- 28. Filter BindingSource with entity framework
- 29. Ninject with Entity Framework - SqlException
- 30. 如何在Java WebDriver中使用Selenium WebDriver選擇2nd Level SubMenu
這可能取決於你的情況。諸如「哪個更好」等問題取決於必須達到的目標。你想做什麼? – siebz0r