-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: problems on session.delete()
PostPosted: Mon Aug 30, 2004 11:18 pm 
Newbie

Joined: Sat Aug 21, 2004 12:22 am
Posts: 3
Want to delete the records by the loginname. a is the value returns the number of rows which will be deleted. If I used session.flush(), the record is deleted. However, it returned the errors. If I don't use session.flush(), the records still here.

Hibernate version:

2.1.6

Mapping documents:

Code between sessionFactory.openSession() and session.close():

int a =
session.delete("from com.company.SubscribeHobby SubscribeHobby where SubscribeHobby.loginname = ?",loginname, new StringType());
session.flush();

Full stack trace of any exception that occurs:

javax.servlet.ServletException: net.sf.hibernate.HibernateException: SQL insert, update or delete failed (row not found)
at org.apache.struts.action.RequestProcessor.processException(RequestProcessor.java:516)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:423)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:226)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1158)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:415)

.
.
.

Name and version of the database you are using:

MySQL 4.0

Debug level Hibernate log excerpt:

If session.flush() is called, it will has SQL delete statement in tomcat log.
Otherwise, no SQL delete statement.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.