关于hibernate的save方法和persist方法的区别

文章转载地址:https://blog.csdn.net/xiatianlong_xtl/article/details/55005449

save : 在事务里执行到save,会向数据库插一条数据,如果事务里异常,会回滚,删除数据库中插入的数据。

persist:在事务里执行到persist,不会向数据库插数据,事务commit了才会插入数据。

猜你喜欢

转载自blog.csdn.net/rumengqiang/article/details/81477902