-->
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: Native id generator and transaction
PostPosted: Wed Feb 02, 2011 3:01 am 
Newbie

Joined: Thu Mar 11, 2010 7:39 am
Posts: 3
Hi,

I am using native id generation and spring declarative transaction. Now, in a method that is wrapped in transaction, the updates rollback but not the inserts. The insert rollback works when I change the id generation to increment. We require to use a native id generation, since, we may have multiple hibernate applications hitting the same database.

Following are my configurations:
Code:
<hibernate-mapping>
   <class name="com.company.product.hb.Users" table="Users">
      <id name="id" type="java.lang.Long">
         <column name="id" />
         <generator class="native" />
      </id>
...


Code:
<bean id="transactionManager"   class="org.springframework.orm.hibernate3.HibernateTransactionManager">
   <constructor-arg>
             <ref local="sessionFactory"/>
   </constructor-arg>
</bean>

<bean id="UserManagerService" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
   <property name="target" ref="UserManager" />
   <property name="transactionManager">
      <ref bean="transactionManager" />
   </property>
   <property name="transactionAttributes">
      <props>
              <prop key="*">
                  PROPAGATION_REQUIRED,
                   -java.lang.Exception
                        </prop>         
           </props>
   </property>
</bean>



Kindly let me know if I have missed out any more info required.

Thanks for any pointers,
Samarth


Top
 Profile  
 
 Post subject: Re: Native id generator and transaction
PostPosted: Tue Feb 08, 2011 2:51 am 
Newbie

Joined: Thu Mar 11, 2010 7:39 am
Posts: 3
Kindly follow the following thread, & let me know any comments

http://forum.springsource.org/showthread.php?p=344336

Thanks


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.