Hibernate SaveError
Org.hibernate.StaleStateException:Batch Update returned unexpected row count from update:0 actual row count:0 expected: 1
How to update the error?
The original value is null
dboperate dbo = new Dboperate ();
News_inf Inf1 = new News_inf ();
Inf1 = (news_inf) Dbo.getobjetctbyid (INF1, "News_inf", Request.getparameter ("id"));/The value here is empty.
Inf1.setid (Pubfunc.parseint (Request.getparameter ("id"));/This can not be.
Inf1.settitle (Request.getparameter ("title"). GetBytes ("gb2312"), "iso-8859-1");//I have a filter, no need to think about writing back.
Inf1.setdatetime (D.tolocalestring ());
Inf1.settypeid (Pubfunc.parseint (Request.getparameter ("typeID"));
inf1.setfrees (Request.getparameter ("Frees"));
Inf1.setnewss (Request.getparameter ("Newss"));
Inf1.setredian (Request.getparameter ("Redian"));
inf1.setcontent (New String (Request.getparameter ("content"). GetBytes ("gb2312") , "iso-8859-1"));
dbo.insert_update (INF1, "Update");
This is where my Dboperate.java is posted.
Package com.pp.db;
Import My. Hibernateutil;
Import java.sql.*;
Import java.util.*;
Import Org.apache.commons.logging.Log;
Import Org.apache.commons.logging.LogFactory;
Import Org.apache.log4j.Logger;
Import Org.hibernate.SessionFactory;
Import org.hibernate.Session;
Import org.hibernate.Transaction;
Import org.hibernate.cfg.Configuration;
Import org.hibernate.*;
Import javax.naming.*;
Import Com.jetsum.util.PubFunc;
Import java.util.List;
Import java.io.IOException;
Import Java.io.InputStream;
Import jxl.*;
Import Java.io.FileInputStream;
Import Java.io.File;
Import My.bean.member;
Import java.sql.PreparedStatement;
Import java.io.*;
</