log4j:WARN No appenders could be found for logger (org.hibernate.cfg.Environment).
log4j:WARN Please initialize the log4j system properly.
Hibernate: insert into name1.dbo.users (username, password) values (?, ?)
org.hibernate.TransactionException: Transaction not successfully started
at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:100)
at org.DoDao.hibernatee.qq(hibernatee.java:33)
at org.DoDao.ww.main(ww.java:11)
Exception in thread "main" org.hibernate.SessionException: Session was already closed
at org.hibernate.impl.SessionImpl.close(SessionImpl.java:275)
at org.DoDao.hibernatee.qq(hibernatee.java:38)
at org.DoDao.ww.main(ww.java:11)
Hibernate 插入成功了还报错???请教。。
答案:2 悬赏:50 手机版
解决时间 2021-06-01 06:52
- 提问者网友:缘字诀
- 2021-05-31 23:52
最佳答案
- 五星知识达人网友:逃夭
- 2021-06-01 00:09
事物并没有开始执行。也就是楼主代码逻辑有些问题,当插入数据库成功的时候也提交了事物。
全部回答
- 1楼网友:鱼芗
- 2021-06-01 00:29
事务没有成功开启
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯