1

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>
4
  • 2
    How can we help you when you don't show use the SQL query that fails? Plus are you using the same database in both cases? Commented May 21, 2021 at 9:21
  • I can't share queries because for company restriction, it is simply session.persist(entity); session.flush(); Commented May 21, 2021 at 9:27
  • I assume that you don't use the same database schema Commented May 21, 2021 at 10:58
  • in the stacktrace of the SQLGrammarException there should be the why. if you can't share the query and the exception could you alter names maintaining consistency and tell us a similar query? Commented May 21, 2021 at 18:40

1 Answer 1

1

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.