zoukankan      html  css  js  c++  java
  • javax.persistence.RollbackException: Error while committing the transaction

    the valid jpa update entity code gives the exception below in the case of  wrong dependency( org.hibernate,  hibernate-core,  4.2.0.CR1)
       


            entityManager.getTransaction().begin();
            CompactDisc compactDisc = entityManager.find(CompactDisc.class, 7777);
            compactDisc.setTitle("ZZZZZZZ");
            entityManager.getTransaction().commit();
            entityManager.close();



    Exception in thread "main" javax.persistence.RollbackException: Error while committing the transaction
        at org.hibernate.ejb.TransactionImpl.commit(TransactionImpl.java:92)
        at com.conygre.training.entities.LifecycleTester.main(LifecycleTester.java:25)
    Caused by: java.lang.NullPointerException
        at org.hibernate.ejb.event.EJB3PostUpdateEventListener.handlePostUpdate(EJB3PostUpdateEventListener.java:71)
        at org.hibernate.ejb.event.EJB3PostUpdateEventListener.onPostUpdate(EJB3PostUpdateEventListener.java:67)
        at org.hibernate.action.internal.EntityUpdateAction.postUpdate(EntityUpdateAction.java:248)
        at org.hibernate.action.internal.EntityUpdateAction.execute(EntityUpdateAction.java:205)
        at org.hibernate.engine.spi.ActionQueue.execute(ActionQueue.java:362)
        at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:354)
        at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:276)
        at org.hibernate.event.internal.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:328)
        at org.hibernate.event.internal.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:52)
        at org.hibernate.internal.SessionImpl.flush(SessionImpl.java:1212)
        at org.hibernate.internal.SessionImpl.managedFlush(SessionImpl.java:400)
        at org.hibernate.engine.transaction.internal.jdbc.JdbcTransaction.beforeTransactionCommit(JdbcTransaction.java:101)
        at org.hibernate.engine.transaction.spi.AbstractTransactionImpl.commit(AbstractTransactionImpl.java:175)
        at org.hibernate.ejb.TransactionImpl.commit(TransactionImpl.java:75)


    As a resolution Change the version to to 4.1.9.Final or 3.6.10.Final

  • 相关阅读:
    mysql命令集锦
    linux 删除文件名带括号的文件
    linux下的cron定时任务
    struts2文件下载的实现
    贴一贴自己写的文件监控代码python
    Service Unavailable on IIS6 Win2003 x64
    'style.cssText' is null or not an object
    "the current fsmo could not be contacted" when change rid role
    远程激活程序
    新浪图片病毒
  • 原文地址:https://www.cnblogs.com/sos-blue/p/3464646.html
Copyright © 2011-2022 走看看