Sorry, I just provided an example and cannot include the actual source. The foreign keys are working in my application because w/o lazy loading enabled I do not have the caching problem.
Also, I have second level cache disabled with (also query cache):
Code:
hibernate.cache.use_second_level_cache=false
hibernate.cache.use_query_cache=false
So basically, instead of saving the transaction, I want to add the transaction to the set that belongs to the person and save the person and have the save cascaded.
There is no mechanism to automatically do this?
Take a look at
http://www.hibernate.org/hib_docs/v3/reference/en/html_single/#objectstate-transitive. So refresh looks like a good idea for cascade, but the Javadoc says "It is inadvisable to use this to implement long-running sessions that span many business tasks".