-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Data inserted using PL/SQL function not visible for session?
PostPosted: Fri Aug 24, 2007 6:23 am 
Newbie

Joined: Fri Nov 03, 2006 5:15 am
Posts: 2
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?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.