1. 程式人生 > >org.springframework.orm.jpa.JpaSystemException問題記錄

org.springframework.orm.jpa.JpaSystemException問題記錄

... 過程 ner comm 出現 lec dia nested oracl

最近在使用jpa的過程中出現了如下異常:


org.springframework.orm.jpa.JpaSystemException: could not execute statement; nested exception is org.hibernate.exception.GenericJDBCException: could not execute statement
at org.springframework.orm.jpa.vendor.HibernateJpaDialect.convertHibernateAccessException(HibernateJpaDialect.java:333)
...
Caused by: org.hibernate.exception.GenericJDBCException: could not execute statement
at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:47)
...
... 74 common frames omitted
Caused by: java.sql.SQLException: ORA-14400: 插入的分區關鍵字未映射到任何分區

at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:70)
...
</pre>

部分異常代碼省略,上邊的異常應該很容易看出問題,就是入庫的數據超過了數據庫已有分區的限制,增加數據庫分區即可。
但在解決問題的過程中總結出如下兩個要點:
1、看問題不能只片面的看個開頭,或許答案就在最後。
2、項目中的日誌尤其重要,debug看不出來的問題,有時候都打印在了日誌中。

org.springframework.orm.jpa.JpaSystemException問題記錄