I added the cascade to the many-to-many set.
The code I use to insert the proof into the set is as follows:
User user = (User)getSession().load(md.user.User.class, (Long) iterator.next());
getProof().getLatestVersion().getUsers().add(user);
user.getPendingProofs().add(getProof());
commitContinue();
When I do that now, I get a TransientObjectException:
The following error has been reported:
java.lang.Exception: net.sf.hibernate.TransientObjectException: object references an unsaved transient instance - save the transient instance before flushing: md.user.User
We use a custom set of classes to take care of commits and db connections. The three classes we use are HibernateMonitor (a tapestry extension of sorts), HibernateEngine, and HibernateSessionSource. You can see the source for them here:
http://thechrisproject.com/prog/
Thanks for your reply!