-->
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.  [ 2 posts ] 
Author Message
 Post subject: Transaction gets Commited when data is Flushed
PostPosted: Wed Mar 04, 2009 11:03 pm 
Newbie

Joined: Wed Mar 04, 2009 9:20 pm
Posts: 2
Location: Melbourne
Hi,

I am new to Hibernate and I am facing this weird issue of Transaction getting commited whenever the data is Flushed.

When we do an Insert/Update operation and execute a query, data gets flushed automatically as the FlushMode.AUTO is set by default. At this stage, Transaction is getting commited which is causing serious issues in our application.

Is this an expected behaviour of Hibernate to commit transaction on FLUSH???
Or is there some setting which we miss in our application to avoid this??

Code:
  <bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
        <property name="dataSource" ref="dataSource" />
        <property name="persistenceUnitManager" ref="persistenceUnitManager" />
        <property name="jpaVendorAdapter" ref="jpaVendorAdapter" />
        <property name="persistenceUnitName" value="bdmPU" />
       
        <property name="jpaProperties">
            <props>
               <prop key="hibernate.show_sql">true</prop>
               <prop key="hibernate.use_sql_comments">true</prop>
               <prop key="hibernate.bytecode.provider">javassist</prop>
            </props>
        </property>
    </bean>

    <bean id="persistenceUnitManager" class="org.springframework.orm.jpa.persistenceunit.DefaultPersistenceUnitManager">
        <property name="defaultDataSource" ref="dataSource" />
    </bean>

    <bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
        <property name="entityManagerFactory" ref="entityManagerFactory" />
        <property name="jpaDialect">
            <bean class="org.springframework.orm.jpa.vendor.HibernateJpaDialect" />
        </property>
    </bean>

_________________
Regards,
Venky.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 05, 2009 2:15 am 
Beginner
Beginner

Joined: Wed Nov 19, 2008 8:25 am
Posts: 46
Location: Saint Petersburg, Russian Federation
It's not clear how do you work with the database at the moment. There are number of possible problems. I suggest to try the test-case in non-spring environment in order to find out if it's related to the problem. If the problem persists just post your mappings and test-case here.


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

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.