Our Project requires a bulk upload of data into the database on a trasactional basis. We are using Spring's TransactionProxyFactoryBean to provide declarative transactions in our method. I was doing a load test and found that trying to create about 10000 records in a transaction is taking about 1 hour. If i take the loop out of the method and call it outside of the service layer, the same process takes about 15 minutes.
Can anybody help me understand why this is happening? My CPU is at 100% when i run the bulk upload.
Here is my application-context code for the service in question
<bean id="tradingPartnerService"
class="org.springframework.transaction.interceptor .TransactionProxyFactoryBean">
<property name="transactionManager" ref="transactionManager" />
<property name="preInterceptors">
<list>
<ref local="serviceInterceptor" />
</list>
</property>
<property name="target">
<bean
class="com.ebizformedia.service.impl.TradingPartne rServiceImpl">
<property name="tradingPartnerDao">
<ref bean="TradingPartnerDao" />
</property>
<property name="targetTradingPartnerDao">
<ref bean="TargetTradingPartnerDao" />
</property>
<property name="aliasDao">
<ref bean="AliasDao" />
</property>
<property name="searchDao">
<ref bean="SearchDao" />
</property>
<property name="gatewayRoutingDao">
<ref bean="GatewayRoutingDao" />
</property>
<property name="commonUtilsService">
<ref bean="commonUtilsService" />
</property>
<property name="entityAccessService">
<ref bean="entityAccessService" />
</property>
<property name="contactService">
<ref bean="contactService" />
</property>
<property name="mediaTypeService">
<ref bean="mediaTypeService" />
</property>
</bean>
</property>
<property name="proxyTargetClass" value="true" />
<property name="transactionAttributes">
<props>
<prop key="*">PROPAGATION_REQUIRED</prop>
</props>
</property>
</bean>


Reply With Quote