wood burning stoves 2.0*
The moose likes Architect Certification (SCEA/OCMJEA) and the fly likes JPA Caching for Performance Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Architect Certification (SCEA/OCMJEA)
Bookmark "JPA Caching for Performance" Watch "JPA Caching for Performance" New topic
Author

JPA Caching for Performance

Sandeep Khanzode
Greenhorn

Joined: Apr 09, 2011
Posts: 11
To achieve better performance, JPA entities can be cached. Since SCEA 5 tests for Java EE 5 which has JPA 1.0 support and JPA 2.0 came much later, can we consider JPA 2.0 to be part of our solution? As JPA supports shared caching etc. If not, is it possible to include a non-standard framework like EHCache in our solution? Please discuss your thoughts on this. Thanks,
Marcelo Ortega
Ranch Hand

Joined: May 31, 2005
Posts: 519

I think it should be ok to use JPA 2.0 as I recall focusing on this particular version for part 1 (dont have my notes with me though so cant confrm). I wouldnt risk using anything outside of JEE.. but thats just me being safe


SCJP 1.4, SCWCD 1.4, SCBCD 1.3, SCJD, SCEA/OCMJEA

Live life to an interface, not an implementation!
Rishi Shehrawat
Ranch Hand

Joined: Aug 11, 2010
Posts: 218

Since JPA 2.0 is not part of JEE5, I used a custom caching component. I used Ehcache as the cache provider for the custom component. I justified using Ehcache vis-a-vis custom cache implementation in design decisions.
Krishna Jonnalagadda
Ranch Hand

Joined: Feb 09, 2010
Posts: 43
I am also struggling to use a caching mechanism for assignment. How about the following two options:

1. Use a DAO,DAOFactory implementation using plain JDBC ? The petstore example uses this ...but its prior EJB 3 though ...
2. Leave this open to the developers who'll develop this..Just mention to use some caching mechanism ...

Any comments ?
Rishi Shehrawat
Ranch Hand

Joined: Aug 11, 2010
Posts: 218

1. Use a DAO,DAOFactory implementation using plain JDBC ? The petstore example uses this ...but its prior EJB 3 though ...

Given productivity gains, ease of use, etc. you should have a very good reason for not using ORM. I would not suggest using plain JDBC.

2. Leave this open to the developers who'll develop this..Just mention to use some caching mechanism ...

In my opinion, this needs to be part of the architecture & cannot be left to the developer.
Tad Senn
Greenhorn

Joined: Jul 24, 2011
Posts: 2
Rishi Shehrawat wrote:
1. Use a DAO,DAOFactory implementation using plain JDBC ? The petstore example uses this ...but its prior EJB 3 though ...

Given productivity gains, ease of use, etc. you should have a very good reason for not using ORM. I would not suggest using plain JDBC. [...]


A certain assignement has very high performance requirements and uptime ... Is that a good reason ? Or EJB 3 would be always better ?
Rishi Shehrawat
Ranch Hand

Joined: Aug 11, 2010
Posts: 218

There is a perception that hand coded JDBC is always more performant than ORM, which i feel is not completely correct. You can start with ORM, for the areas where you find that ORM is not fast enough you can use SQL as this option is also availaible when you use ORM.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JPA Caching for Performance
 
Similar Threads
Spring JDBC Vs Hibernate?
adding new locale support dynamically - is possible?
Hibernate 3.x and JPA 1.0?
Caching
Difference between JPA 1.0 and JPA 2.0?