I\'m enhancing an old Spring/Hibernate application and im stuck. I have a method that reads a file 3000+ lines long, each line has a record which has to be compared with somethi
Replace the load method with the get method..
I found out after doing more research that the load method doesn't really load the object from the database. Instead it automatically returns a proxy object. Load assumes the object has already been "gotten with get" from the database and is in the cache.
Just use get instead of load if you want to make sure you hit the database, and make sure you know the difference between these 2 methods.
Source: this spring forum comment
I've personally test this and it is right, the load method don't retrieve all the wanted data from the DB. Using get fixed my problem.