This forum is now a read-only archive. All commenting, posting, registration services have been turned off. Those needing community support and/or wanting to ask questions should refer to the Tag/Forum map, and to http://spring.io/questions for a curated list of stackoverflow tags that Pivotal engineers, and the community, monitor.

AnnouncementAnnouncement Module

Collapse

No announcement yet.

Spring is reloading hibernate entities in Spring 2.5.6 even when they are not called.Page Title Module

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

Apr 26th, 2012, 08:22 AM

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.)