users@glassfish.java.net

Re: RE: Re: Re: JPA: speed vs JDBC

From: <glassfish_at_javadesktop.org>
Date: Thu, 10 Jul 2008 08:11:45 PDT

Hi Markus,

> If doing complex business tasks with lots of JOINS and 99% READ, then JPA will most of the time be faster than JDBC (thanks to the caching which prevents repeated SQL parsing and table scanning).

No experience with JPA, just JDBC on single server so far.
But thinking about your statement i ask me if this really can be true.
Because there is also an caching mechanism on database level, for example MySQL has the Query Cache.

If i think more about JPA Caching vs Database caching, i also consider how people do caching in bigger application.
Doing this application level with JPA means that the server must inform all server of the cluster on each transaction commit, that some cache objects must be removed or reloaded.


Think its better to cache on database level?


Hammoud
[Message sent by forum member 'hammoud' (hammoud)]

http://forums.java.net/jive/thread.jspa?messageID=285687