This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Object Relational Mapping and the fly likes I can't get my query cache to work... 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 » Databases » Object Relational Mapping
Bookmark "I can Watch "I can New topic
Author

I can't get my query cache to work...

Julien Martin
Ranch Hand

Joined: Apr 24, 2004
Posts: 384
Hello,

I can't get my query cache to work. I know I am missing something obvious and would be grateful for some help. Here is my code and the log:









Can anyone help please?

Thanks in advance,

Julien.

PS The param remains the same across requests....
[ April 10, 2007: Message edited by: Julien Martin ]
Julien Martin
Ranch Hand

Joined: Apr 24, 2004
Posts: 384
Problem solved:

I had forgotten to put the entity manager in session or application scope...
My code is now as follows:



Julien.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: I can't get my query cache to work...
 
Similar Threads
Hibernate: Mapping a sequence to a serial (autoincr) field (Postgresql)
Error connecting to MSSQL Server from Hibernate
Beginner needs help with second-level cache
Hibernate Query Caching - Why the misses?
Hibernate/MSSQL/identity column