0
我使用Spring 3.0和休眠4.x,但我面臨事務管理問題。我在服務層使用@Transactional註解,但將大量數據保存到數據庫需要很長時間。使用@Transactional彈簧3.x和休眠4.x事務管理問題使用@Transactional
這裏是我的事務管理器:
<tx:annotation-driven />
<bean id="transactionManager"
class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<property name="sessionFactory" ref="sessionFactory" />
</bean>
而且我使用這行代碼中插入數據:
sessionFactory.getCurrentSession().save(deal);
請,如果有人有解決方案,幫助我。
有插入或更新操作? –
在一般的解決方案是批量插入: http://stackoverflow.com/questions/9718305/batch-insertions-with-hibernate-spring –
我插入數據到數據庫。 – user3061376