Announcement Announcement Module
Collapse
No announcement yet.
Spring is reloading hibernate entities in Spring 2.5.6 even when they are not called. Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring is reloading hibernate entities in Spring 2.5.6 even when they are not called.

    Hi All,

    I have come across some strange behavior in an old application. The application is currently undergoing a 3rd part librbary upgrade, and I have noticed that moving from Spring 2.0.3 to Spring 2.5.6 one of my entites is getting called each and every time there is a DAO call.

    For Example, we have 2 objects, Country and Car. (they have no relationship and are not mapped together in any way)

    The application is a workflow type application that has multiple flows, within the Flow the Car object is loaded with ID 1.

    Later in the flow, a Country object is loaded from the DB but I have noticed that at the same time the Car object ID 1 is reloaded again, the DAO that gets country does not have any reference to Car for example.

    When digging into it a bit more, it looks like any DAO call to the DB results in the Car object 1 getting loaded again.

    We can confirm this behavior has only started to happen with a move from Spring 2.0.3 to 2.5.6 and I am concered that this is going to slow down the application if it is doing this for all queries.


    Any debugging tips would be much appreciated, or ideas. Cant post any code as its as simple as

    dao.getCountry(long id);

    anydao.getSomething(long id);

    cause for example

    Car.setName to be called (which is called when the object is retrieved back from db.)
Working...
X