Issue
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.
Solution
I have added begin transaction in code to resolve the mentioned error.
Transaction trans = session.beginTransaction();
This solution worked for me to resolve this error.
javax.persistence.TransactionRequiredException: Executing an update/delete query
But now getting below new error
ERROR | ORA-12801: error signaled in parallel query server P00V ORA-12829: Deadlock - itls occupied by siblings at block 3591658 of file 175
Answered By - user3552342
Answer Checked By - Mildred Charles (JavaFixing Admin)