Issue
I have a simple create query in my application.( Spring 5.2.10 + Hibernate 5.4.3.1 + Weblogic 12c)
It works good on my local weblogic server but it takes error on another weblogic server when flush. They uses same datasource.
org.hibernate.exception.SQLGrammarException: could not execute statementjavax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: could not execute statement
at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:154)
at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:181)
at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:188)
at org.hibernate.internal.SessionImpl.doFlush(SessionImpl.java:1366)
at org.hibernate.internal.SessionImpl.flush(SessionImpl.java:1349)
at com.thy.dao.impl.BaseDAOImpl.create(BaseDAOImpl.java:46)
I tried to configure weblogic.xml prefer application packages like below , still not works.
<wls:prefer-application-packages>
<wls:package-name>javax.persistence.*</wls:package-name>
<wls:package-name>org.hibernate.*</wls:package-name>
</wls:prefer-application-packages>
</wls:container-descriptor>
Solution
I found the solution, there is no error in sql grammar. Problem releates with a stored procedure/function in db side which triggerred with a new insert. Stack trace not contains this exception , I found it in weblogic logs.
Answered By - İlyas Şahin