首页上一页 1 下一页尾页 1 条记录 1/1页
hibernate删除数据报错
发表在JavaWeb图书答疑
2020-01-28
《Java Web从入门到精通》第16章 Hibernate技术 387页-0页
是否精华
是
否
版块置顶:
是
否
Hibernate: select product0_.id as id1_0_0_, product0_.name as name2_0_0_, product0_.price as price3_0_0_, product0_.factory as factory4_0_0_, product0_.remark as remark5_0_0_ from tab_product product0_ where product0_.id=?
对象删除失败
javax.persistence.TransactionRequiredException: no transaction is in progress
at org.hibernate.internal.AbstractSharedSessionContract.checkTransactionNeededForUpdateOperation(AbstractSharedSessionContract.java:409)
at org.hibernate.internal.SessionImpl.checkTransactionNeededForUpdateOperation(SessionImpl.java:3407)
at org.hibernate.internal.SessionImpl.doFlush(SessionImpl.java:1349)
at org.hibernate.internal.SessionImpl.flush(SessionImpl.java:1345)
at com.mr.main.DeleteProduct.main(DeleteProduct.java:18)