Hello everyone,
I'm trying to break the question down to something simple.
I use nhibernate to get a list of entities via a criteria call. After that I'll update some entites and add one entity which I save (session.SaveOrUpdate(entity)). When I get a list with a criteria again I do get the entities that were changed (with changed values) in my list but not the entity I added. I read that the criteria doesn't use the session cash but "will always result in a SQL query / call to the DB". Well, somehow the entities that I changed are from the session cache (I didn't commit yet and nothing has been written to the database) but the Criteria doesn't "find" my newly added entity. Is it possible to make the Criteria get all entities from the cache (i know the added entity is there cause i can check the keys in the statistics-entitykeys list)?
P.s.:It's somehow strange that I can load a list of entities, ADD AND SAVE some, get the "whole list" again and still only get the ones that were in there the first time. Do I really need to commit to get the full list?
P.s.s: I don't want to use the second level cache cause that would mean i commit changes made in another session too when I "commit", right?