Hibernate version: 3.1.2
Name and version of the database you are using: Oracle 10g
We are using Spring + Hibernate with annotated transactions. Session factory is org.springframework.orm.hibernate3.LocalSessionFactoryBean and in our unit testing environment we use org.springframework.jdbc.datasource.DriverManagerDataSource data sources.
The problem is that the following (slightly simplified) code doesn't work:
Code:
public class SomeDaoImpl extends HibernateDaoSupport {
@Transactional(readOnly=true)
public SomeDO findSomeDO(BigInteger id) {
return (SomeDO) getHibernateTemplate().get(SomeDOImpl.class, id);
}
@Transactional
private BigInteger createSomeDOInner(params) {
// Add data to the DB by calling a PL/SQL function using
// CallableStatement inside a HibernateCallback. Return
// the id of the newly created row returned by the function.
}
@Transactional
public SomeDO createSomeDO(params) {
BigInteger id = createSomeDOInner(params);
return findSomeDO(id);
}
}
When calling method createSomeDO, it returns null. Log file says " done processing result set (0 rows)" and "total objects hydrated: 0". But if I execute the logged SQL query in the database, i get one row.
Can somebody tell me what is the reason for the data inserted by the PL/SQL function not being visible to Hibernate? Some session issue?