Results 1 to 10 of 11

Thread: Committ problems with @Transactional annotations

Threaded View

  1. #1

    Default Commit problems with @Transactional annotations

    Hello folks,

    I am currently trying to implement annotation-based transactions with Spring 2.x and Hibernate with Oracle. So far I configured the <tx:annotation-driven>-tag and the corresponding transaction manager:

    PHP Code:
        <!-- transaction manager -->
        <
    bean id="transactionManager"
            
    class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
            <
    property name="dataSource" ref="dataSource"/>
        </
    bean>

        <
    bean id="sessionFactory"
            
    class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
            <
    property name="configLocation"
                
    value="classpath:hibernate.cfg.xml" />
        </
    bean
    Every service class implementation has a @Transactional annotation attached:

    Code:
    @Transactional
    public class UserServiceImpl ......
    All read operations have "@Transactional(readOnly=true)".

    When using the services to persist some entity there seems to be no problem:

    Code:
    Hibernate: insert into SCHEMA.USER ...........
    ... however the data is not committed to the database. There is no new entry! Where to configure the commit command?
    Last edited by Rapthor; Jul 18th, 2007 at 02:42 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •