Hi,
I'm using Hibernate 3.0.5 with open-session-in-view model and have some problem with session cache.
Everything is happening inside one request.
In this request, first I select all Taxonomies(Taxonomy objects), then based on some other data, update these taxonomies and create new ones. When I create new taxonomies, first I assign associations to them and save them to database - but there are without names. In second step I take these taxomomies and assign generated name for them. when genearion process ends, I again execute "from Taxonomy where ....". Query return updated taxonomies, and newly created ones, but these newly created, they don't have their names (name is null). in this situation it is enough to refresh the page and everything is ok. But I don't know why this first time name is null. I tried to fix it and find out, that if I invoke "session.clear();" after generating taxonomies, everything work well but I sill don't understand it. Can anyone explain it to me?
|