I receive following error when I save the object using Hibernate
object references an unsaved transient instance - save the transient instance before flushi
This occurred for me when persisting an entity in which the existing record in the database had a NULL value for the field annotated with @Version (for optimistic locking). Updating the NULL value to 0 in the database corrected this.