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)
 
 

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


View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3994468#3994468

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3994468
_______________________________________________
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to