Consider an entity with the following annotations on the ID property and a valid second-level cache configuration. Such an entity is not found in the second-level cache right after session.saveOrUpdate(entity)
The following commented out code snippet in EntityIdentityInsertAction.execute() indicates that caching of newly inserted entities in the second-level cache is currently not supported. The according entity only shows up in the second-level cache after loading from the database.
//TODO: this bit actually has to be called after all cascades!
// but since identity insert is called *synchronously*,
// instead of asynchronously as other actions, it isn't
/*if ( persister.hasCache() && !persister.isCacheInvalidationRequired() ) {
cacheEntry = new CacheEntry(object, persister, session);
persister.getCache().insert(generatedId, cacheEntry);
}*/
Also entities with database generated IDs should be put in the second-level cache right after insertion in the database.
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira