Welcome to 16892 Developer Community-Open, Learning,Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I have upgraded Hibernate 4.x version to Hibernate 5.4.x version in my application.

I am getting below error while running below SQL query:

javax.persistence.TransactionRequiredException: Executing an update/delete query at org.hibernate.internal.AbstractSharedSessionContract.checkTransactionNeededForUpdateOperation(AbstractSharedSessionContract.java:413) at org.hibernate.query.internal.AbstractProducedQuery.executeUpdate(AbstractProducedQuery.java:1668)

SQL query:

hibernateSession.createSQLQuery("alter session enable parallel dml").executeUpdate();

Also failing the parallel running delete query after failing of above dml query.

I have tried using the @Transactional annotation (import org.springframework.transaction.annotation.Transactional;) on method level and class level but that didnt resolve my issue.

Any suggestion to resolve this error will be highly appreciable.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
4.5k views
Welcome To Ask or Share your Answers For Others

1 Answer

Looks like your transaction manager integration doesn't work properly then as Hibernate can't join the transaction. Not sure how your Spring configuration looks like, but there must be an issue with that. I guess you also updated Spring? Maybe you are using a now unsupported configuration?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to 16892 Developer Community-Open, Learning and Share
...