当前位置: 代码迷 >> Java Web开发 >> org.hibernate.exception.ConstraintViolationException:   Could
  详细解决方案

org.hibernate.exception.ConstraintViolationException:   Could

热度:95   发布时间:2016-04-17 16:51:17.0
这个东西怎么回事?一提交就这样
type   Exception   report

message  

description   The   server   encountered   an   internal   error   ()   that   prevented   it   from   fulfilling   this   request.

exception  

org.hibernate.exception.ConstraintViolationException:   Could   not   execute   JDBC   batch   update
org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:69)
org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:200)
org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:230)
org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:140)
org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:296)
org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
org.hibernate.impl.SessionImpl.flush(SessionImpl.java:877)
org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:345)
org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:106)
cn.com.blogonline.DbOperate.save(DbOperate.java:335)
cn.com.blogonline.WriteFeedbackAction.doGet(WriteFeedbackAction.java:46)
cn.com.blogonline.WriteFeedbackAction.doPost(WriteFeedbackAction.java:53)
javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)


note   The   full   stack   trace   of   the   root   cause   is   available   in   the   Apache   Tomcat/5.5.9   logs.



------解决方案--------------------
org.hibernate.exception.ConstraintViolationException
看来像是违反了数据表的约束
------解决方案--------------------
ConstraintViolationException - 指明某种类型的约束违例错误
代码迷推荐解决方案:The server encountered an internal error () that prevented it from fulfilling this request.,http://www.daimami.com/search?q=317
  相关解决方案