我需要一些幫助,讓我告訴你我的上下文,我們有兩個測試環境,其中一個Web應用程序指向postgres中的一個數據庫,此應用程序在此處運行得很好,另一個環境中,我們有兩個數據庫是從屬和主要的數據庫,並在應用程序中顯示與數據庫相關的錯誤。無法執行JDBC批處理更新;未分類用於SQL的SQLException
有一個表名爲討論,另一個名爲network_discussion,當我立即保存討論,我保存到network_discussion,但在第二個環境不工作,我認爲這是有關GRANT訪問的東西,但顯然是不,這是錯誤跟蹤:
2012-09-15 15:10:27,162|TP-Processor12|ERROR|mp_sites|web|mpmvstage|/home/matchpoint-web/yfroot||Hibernate operation: Could not execute JDBC batch update; uncategorized SQLException for SQL [insert into users.network_discussion (network_id, user_discussion_id, title, last_updated_dt, id) values (?, ?, ?, ?, ?)]; SQL state [null]; error code [0]; Batch entry 0 insert into users.network_discussion (network_id, user_discussion_id, title, last_updated_dt, id) values (33214047252677632, 33495522229786655, company-corp.com_newdisa, 2012-09-15 15:10:27.153000 -07:00, 33495522229786656) was aborted. Call getNextException to see the cause.; nested exception is java.sql.BatchUpdateException: Batch entry 0 insert into users.network_discussion (network_id, user_discussion_id, title, last_updated_dt, id) values (33214047252677632, 33495522229786655, company-corp.com_newdisa, 2012-09-15 15:10:27.153000 -07:00, 33495522229786656) was aborted. Call getNextException to see the cause.
org.springframework.jdbc.UncategorizedSQLException: Hibernate operation: Could not execute JDBC batch update; uncategorized SQLException for SQL [insert into users.network_discussion (network_id, user_discussion_id, title, last_updated_dt, id) values (?, ?, ?, ?, ?)]; SQL state [null]; error code [0]; Batch entry 0 insert into users.network_discussion (network_id, user_discussion_id, title, last_updated_dt, id) values (33214047252677632, 33495522229786655, company-corp.com_newdisa, 2012-09-15 15:10:27.153000 -07:00, 33495522229786656) was aborted. Call getNextException to see the cause.; nested exception is java.sql.BatchUpdateException: Batch entry 0 insert into users.network_discussion (network_id, user_discussion_id, title, last_updated_dt, id) values (33214047252677632, 33495522229786655, company-corp.com_newdisa, 2012-09-15 15:10:27.153000 -07:00, 33495522229786656) was aborted. Call getNextException to see the cause.
java.sql.BatchUpdateException: Batch entry 0 insert into users.network_discussion (network_id, user_discussion_id, title, last_updated_dt, id) values (33214047252677632, 33495522229786655, company-corp.com_newdisa, 2012-09-15 15:10:27.153000 -07:00, 33495522229786656) was aborted. Call getNextException to see the cause.
at org.postgresql.jdbc2.AbstractJdbc2Statement$BatchResultHandler.handleError(AbstractJdbc2Statement.java:2512)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1314)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:347)
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeBatch(AbstractJdbc2Statement.java:2574)
at org.apache.commons.dbcp.DelegatingStatement.executeBatch(DelegatingStatement.java:297)
at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:48)
at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:246)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:235)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:139)
at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:298)
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)
at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:338)
at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:106)
at org.springframework.orm.hibernate3.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:584)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:500)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:473)
at org.springframework.transaction.interceptor.TransactionAspectSupport.doCommitTransactionAfterReturning(TransactionAspectSupport.java:267)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170)
at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:623)
at com.netblue.matchpoint.service.DiscussionService$$EnhancerByCGLIB$$b685dad0.addOrGetDiscussions(<generated>)
at com.netblue.matchpoint.filter.DiscussionFilter.doFilter(DiscussionFilter.java:30)
at com.netblue.matchpoint.sitecontroller.MpBaseSiteController.getFilteredParams(MpBaseSiteContr
再這樣下去,我的意思是錯誤跟蹤持續多,所以給了我一個想法是偉大的任何幫助,我在谷歌已經跟蹤這一點,但沒有結果,謝謝。
如果您可以提供您的休眠映射和實體,將會有所幫助。順便說一下,由於堆棧跟蹤提示「調用getNextException來查看原因」,您可以調用getNextException來處理異常,以獲得根本原因 – Shailendra
我實際上已經修復它,我將在一個答案中解釋它... – user1652761