ew0kian wrote:
if i'm using 2nd level cache... and i manually insert some data into the db via command line (not using a hibernate session)... will the cache return old data to users?
If you are inserting then no because the data didn't exist before but I assume you are talking about updating data that is cached in a L2 Cache. In that case it depends. Entities are fetched off a L2 Cache only when they are selected with a key. This include all find by primary key methods and/or relations that are fetched with a select. HQL queries or SQL queries do not use a L2 Cache. At the same time, you can set a limit for the amount of time an entity stays in a L2 Cache so that you make sure at least every xx seconds you get fresh data.
Farzad-