How to fix the Hibernate “object references an unsaved transient instance - save the transient instance before flushing” error

前端 未结 30 1110
既然无缘
既然无缘 2020-11-22 07:11

I receive following error when I save the object using Hibernate

object references an unsaved transient instance - save the transient instance before flushi         


        
30条回答
  •  孤独总比滥情好
    2020-11-22 07:26

    If you're using Spring Data JPA then addition @Transactional annotation to your service implementation would solve the issue.

提交回复
热议问题