hibernate session.save() does not reflect in database

后端 未结 9 2131
臣服心动
臣服心动 2020-12-08 14:30

According to my understanding in hibernate (please confirm)

1- You have to session.close() if you get it by getSessionFactory().openSession()

9条回答
  •  旧巷少年郎
    2020-12-08 15:14

    I found I had to flush and then refresh the DAO, and then it worked.

    session.flush()
    session.refresh(entityDAO)
    

提交回复
热议问题