pgrillo wrote:
The question is sort of 2 part.
1) Does hibernate not cache objects on read within a session?
yes it does. But depending on your "lazy flag" initialization does it depend on whether the objects contain data or not. If Lazy is on and you are accessing a collection for the first time from loading the parent (ie parent.children) then you will be selecting again.
pgrillo wrote:
2) Does the SQL output from Hibernate mean that it really went to the database and issued the SQL command?
no. it actually did not issue the select command.
pgrillo wrote:
If the sql trace doesn't indicate that it necessarily was issued, is there a way to tell whether subsequent calls to get a list of objects use the cache.
The best way to convince yourself is to make sure to issue the first query, then stop your program in a debugger, and then update the database by changing a value in your table (make sure to commit), then continue with your debugger to the next query - if the query was actually issued it would contain the newly modified values...
You can setup hibernate to have different isolation levels, however; and you can ask hibernate to requery everytime too.