I had put an interceptor for hibernate events and this is what i am able to observe so far..
1. when i query the hibernate objects through mapping e.g., classAobj.getClassBObjects(), hibernate is firing query to retrieve the ClassB objects as expected.
2. When i change this flow by replacing querying part for ClassB objects by firing a seperate query instead, hibernate is first doing a dirty check on the classA object and then fires the query.
ClassB is mapped as lazy = true collection with ClassA.
So, I am wondering in which instance of the above (i.e., querying through mapping and querying through hsql query) will hit the database and get the latest data...
any useful links will be appreciated.
|