For a project I'm working on, i'm adding import/export functionality. This is working OK, no issues.
What I'm trying to do now, is to have an option called "dryRun" which allows the user to test the import before actually doing anything, and just give an report back.
So, my setup is:
- Getting the import data through spring mvc (with OpenSessionInView)
- Deserialize this into my domain classes (which are the actual mapped hibernate classes)
- Scan through everything and make sure that references etc are ok.
- All my services have a @Transactional around them
This is mostly OK, but somewhere.. a save is triggered (i never call save), and my grouping object is complaining about a transient reference.. which is correct, since it is not saved.. I assume this is some kind of default mode hibernate has, since the grouping object references another object that is mapped.. So how can I make sure that hibernate never saves anything? without removing the @Transactional and OpenSessionInView (which is needed for the normal case)
Any ideas?
Regards, Morten