I do NOT want hibernate caching in Play
I am developing a pretty simple application with Play, which contains a jQuery UI autocomplete. This autocomplete sends an ajax request to the server and brings back id/values (using the code snippet provided by Peter Hilton).
I have a problem with Selenium testing reloads : - when i start my application in test mode (play test), it loads id/values in memory db (through the bootstrap feature) - when i launch my selenium tests, it deletes the data and loads the test data with the same values, but with new ids (which seems normal to me) - when the test runs, the autocomplete brings back the old id/values instead of the new ones and i get a "object not found for id nn" => the old values seems to be loaded into a server cache, but as the Play documentation explains it, it should not...
I checked i used @javax.persistence.Entity
and not the hibernate @Entity
I also checked my application.conf which seems normal :
%test.application.mode=dev
%test.db.url=jdbc:h2:mem开发者_开发技巧:play;MODE=MYSQL;LOCK_MODE=0
%test.jpa.ddl=create-drop
%test.mail.smtp=mock
Help please...
JPA use Hibernate so it doesn't matter which Annotation you use. But I don't think that this is an hiberante issue, because every request should get a new Hibernate-Session. So analyze your code with log-statements to make sure it's an hibernate-issue.
By default Hibernate only uses a session (this is not the Http Session) cache, which is basically as long as duration of a request, See http://community.jboss.org/wiki/SessionsAndTransactions
So I don't believe the issue you gave is with Hibernate unless you have configured a second level cache and are using @Cache on your entities.
This could be caused by something as simple your browser cache. Try deleting the browser cache.
精彩评论