0 Replies Latest reply on Dec 16, 2006 10:43 PM by Sue

    org.hibernate.TransactionException: Transaction not successf

    Sue Newbie

      why do I get the following error when I execute this method:


      private void updatePerson(Long personId, String firstname) {

      Session session = HibernateUtil.getSessionFactory().getCurrentSession();

      session.beginTransaction();

      Person aPerson = (Person) session.load(Person.class, personId);

      aPerson.setFirstname(firstname);
      session.update(aPerson);
      session.save(aPerson);

      session.getTransaction().commit();
      }

      exception

      org.hibernate.TransactionException: Transaction not successfully started
      org.hibernate.transaction.JDBCTransaction.rollback(JDBCTransaction.java:149)
      events.PersonServlet.doGet(Unknown Source)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:697)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
      org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)


      --------------------------------------------------------------------------------