|
|
Re: JPA caching [message #1007746 is a reply to message #1007353] |
Thu, 07 February 2013 11:58 |
Super User Messages: 9 Registered: January 2013 |
Junior Member |
|
|
Greetings Mr. Sutherland,
Thank you for your response. It is really helpful for me.
I have read EclipseLink wiki articles, but unfortunately it avoids me does JPA keep cache actual on delete or create data from tables stored procedures call.
For example we have table db_entities, object model
/*
Entity declarations
*/
class CurrentEntity{
/*
Id and serialization declarations
*/
private Long id;
/*
Column declarations
*/
private String name;
}
And stored procedures for create and delete data:
begin
delete from db_entities where id=param;
end;
begin
insert into db_entities values(name /*, etc.*/);
end;
Could you please help to find answer the question will JPA Cache track database table changes on these stored procedures call?
Greatest thanks in advance,
[Updated on: Thu, 07 February 2013 11:58] Report message to a moderator
|
|
|
Re: JPA caching [message #1007857 is a reply to message #1007746] |
Thu, 07 February 2013 18:55 |
Chris Delahunt Messages: 1389 Registered: July 2009 |
Senior Member |
|
|
The query cache is used to avoid executing the query a second time. The hints shown in the link can only be added to and used with read queries and should not be added to a query that modifies data, and data modified through native SQL, procedure or even bulk update+delete do not change the data that has been cached. This is part of why the link suggests using it for data that is relatively static or read only.
Can you explain what it is you are looking to cache and why?
Best Regards,
Chris
[Updated on: Thu, 07 February 2013 19:03] Report message to a moderator
|
|
|
Re: JPA caching [message #1008081 is a reply to message #1006336] |
Fri, 08 February 2013 20:02 |
Super User Messages: 9 Registered: January 2013 |
Junior Member |
|
|
Greetings Mr. Delahunt,
Thank you for your attention to my post.
My general idea is to use in my application both features of link cache feature (I assume link cache is being kept actual even on grid database architecture with right application server) and power of native sql queries (like force index, insert on duplicate key etc).
So, I'm trying to have opportunity to reach all of features to prevent making extra times database data extraction (with link cache), to obtain database performance with highly optimized JPA queries (with native sql language I assume) and to map queries result to objects (with basic link functionality).
Thank you,
[Updated on: Fri, 08 February 2013 20:07] Report message to a moderator
|
|
|
Powered by
FUDForum. Page generated in 0.04627 seconds