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.

Persisted changes not found in subsequent criteria.list()Page Title Module

Persisted changes not found in subsequent criteria.list()

Apr 29th, 2009, 08:33 AM

Hi,

I am using a criteria.list() to retrieve a list of people with their travel arrangements, but when I persist some changes to one of those individual's travel arrangements immediately before - these changes are not being picked up.

Before service.getTravellers() is called, I can see from the database that the changes have already been persisted. Even though the Traveller.hbm.xml has the associated TravelRef set with a 'lazy=false', the sql logging shows that there is no attempt to re-get the TravelRef instances. I'm assuming that this is because the saveOrUpdate() and the criteria.list() are using different sessions, and the latter one is unaware of the changes - but what should I be doing to make sure that the changes are retrieved?