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.