Hello,
We are using hibernate in our project to access the data from the DB2, Oracle databases.
In order to make the insert, update, delete functionality configurable we are calling stored procedures, some of them with sql-insert, sql-update, sql-delete hibernate functionality: https://docs.jboss.org/hibernate/orm/3.6/reference/en-US/html/querysql.html#querysql-cud , others calling some stored procedures defined as named queries.
Our application was tested using DB2 installed on a windows environment and found that even if some records were updated, inserted from stored procedures they are rollback when an exception happens. We found that it works also with Oracle, but not with DB2 installed on iSeries.
We are using Spring, HibernateTransactionManager and @Transactional annotation for the methods.
Do you have any information that in some situations the transactions are not rolled back correctly on some versions of IBM DB2 database (more exactly on the ones from iSeries)? This happen mostly in case of unique constraint violation.
Could this be a problem with the nested transactions?
Code:
<bean id="transactionManager"
class="org.springframework.orm.hibernate4.HibernateTransactionManager">
<property name="sessionFactory" ref="mysessionFactory"></property>
<property name="globalRollbackOnParticipationFailure" value="false" />
<property name="nestedTransactionAllowed" value="true" />
</bean>
Thank you.