Affects Version/s: None
Fix Version/s: None
Environment:Click 0.18 (but I believe it is the same in current CVS version)
Calling CayenneForm.getDataObject() more than once for the NEW object results in duplicate insert. I have a case when I need to manipulate a DataObject before saving it, so the action method code looks like this:
// 'getDataObject() - call #1
JobPost post = (JobPost) form.getDataObject();
// do something to POST
// 'getDataObject() - call #2
here two records are inserted instead of one.
So maybe we should store DataObject in a transient field of the form for the duration of request, so that consecutive calls to getDataObject do not instantiate it again?