. Springframework.orm.hibernate3.HibernateJdbcException:JDBC exception on Hibernate data access:sqlexception for SQL [ Insert into Tb_news (N_title, N_content, N_style, N_addtime, N_addadmin, N_ispublish, N_publishtime, N_publishadmin, n_up DateTime, N_updateadmin, N_location, N_isshield, N_shieldtime, N_shieldreason, N_shieldadmin, N_deleteadmin, N_ Deletetime, N_clicknum, N_url, N_isdelete, t_id, n_id) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?, ?, ?)]; SQL state [72000]; Error code [1461]; Could not execute JDBC batch update; Nested exception is org.hibernate.QueryTimeoutException:Could not execute JDBC batch update
Org.springframework.orm.hibernate3.SessionFactoryUtils.convertHibernateAccessException ( sessionfactoryutils.java:645)
Org.springframework.orm.hibernate3.HibernateTransactionManager.convertHibernateAccessException ( hibernatetransactionmanager.java:793)
The problem occurs because the UPDATE statement cannot be executed.
Possible situation
1 The length of the database field is limited, when the data length exceeds the length of the data, the test method can add a try catch block in the access method, and you can see the cause of the exception clearly
2 fields that are not empty in the database are inserted into empty fields. Carefully check that the parameters passed from the page are accepted correctly and that the data that was inserted violates the database field constraints
All exceptions appear as follows:
Org.springframework.orm.hibernate3.HibernateJdbcException:JDBC exception on Hibernate data access; Nested exception is org.hibernate.exception.GenericJDBCException:Could not execute JDBC batch update
JDBC generates an exception that occurs when I modify my data and then save it.
Situation Description:
Occurs when I modify the data and invoke Spring's gethibernatetemplate (). Merge (person); It's changed. Update (person); (The difference between the update () and the merge () method is not quite clear)
Problem solving:
May be my stupid relationship, I put the cache clean, have restarted the next server, and with a breakpoint always with the code, the result is gone, nothing unusual. I am happy, but still do not know how can happen such a mistake, depressed.
Correction: Cause this exception is not because of caching and breakpoints, the reason why did not delete the above conclusions to remind yourself to encounter problems to think, don't old silly pull the fantasy.
In fact, the cause of the problem is very simple, I set up the database when the personname to not NULL, which I accidentally did, but I was in the foreground when the value of the change did not pass the time (in fact, with the merge () can not be transmitted, But do not know why is not the PersonName pass this one time, so caused the above error, when I add <input type= "hidden" value= "Personso.personname" Name= "<WW: The property value= ' Personso.personname '/> ' was passed, but it's strange that if you use the merge (), you don't have to pass the value of the database again, but you need to figure it out.
Author: csdn Blog tfy1332
Back to the column page: http://www.bianceng.cnhttp://www.bianceng.cn/Programming/Java/