Announcement Announcement Module
Collapse
No announcement yet.
Unable to insert more than 7 records Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Unable to insert more than 7 records

    Hi,

    I am working on a project with Spring + Hibernate + Quartz scheduler combination. The scheduler starts after avery 2 minutes and checks if there is data in the db and if it finds some it has to send the data.

    the problem i am now facing is that the scheduler starts and stops abrubptly after it processes 7 records. it goes into the dao method and does not return.

    I have tried changing the number of threads also.

    Many thanks in advance for immediate help.

    Below is the relevant sections of the applicationContext.xml

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">

    <beans>
    <bean id="propertyConfigurer"
    class="org.springframework.beans.factory.config.Pr opertyPlaceholderConfigurer">
    <property name="locations">
    <list>
    <value>classpath:jdbc.properties</value>
    </list>
    </property>
    </bean>

    <bean id="poisonDataSource"
    class="org.apache.commons.dbcp.BasicDataSource">
    <property name="driverClassName">
    <value>${poison.jdbc.driverClassName}</value>
    </property>
    <property name="url">
    <value>${poison.jdbc.url}</value>
    </property>
    <property name="username">
    <value>${poison.jdbc.username}</value>
    </property>
    <property name="password">
    <value>${poison.jdbc.password}</value>
    </property>
    </bean>

    <bean id="poisonTransactionManager"
    class="org.springframework.orm.hibernate3.Hibernat eTransactionManager">
    <!-- <property name="dataSource" ref="poisonDataSource"/> -->
    <property name="sessionFactory" ref="poisonSessionFactory" />
    </bean>

    <bean id="nativeJdbcExtractor"
    class="org.springframework.jdbc.support.nativejdbc .SimpleNativeJdbcExtractor"
    lazy-init="true" />

    <bean id="oracleLobHandler"
    class="org.springframework.jdbc.support.lob.Oracle LobHandler"
    lazy-init="true">
    <property name="nativeJdbcExtractor">
    <ref local="nativeJdbcExtractor" />
    </property>
    </bean>

    <bean id="poisonSessionFactory"
    class="org.springframework.orm.hibernate3.LocalSes sionFactoryBean">
    <property name="dataSource">
    <ref bean="poisonDataSource" />
    </property>
    <property name="lobHandler">
    <ref bean="oracleLobHandler" />
    </property>

    <property name="useTransactionAwareDataSource" value="true" />
    <property name="hibernateProperties">
    <props>
    <prop key="hibernate.dialect">
    ${poison.hibernate.dialect}
    </prop>
    <prop key="hibernate.showSQL">true</prop>
    <prop key="hibernate.connection.release_mode">on_close</prop>
    <prop key="hibernate.use_streams_for_binary">true</prop>
    <prop key="hibernate.jdbc.batch_size">0</prop>
    <prop key="hibernate.c3p0.minPoolSize">5</prop>
    <prop key="hibernate.c3p0.maxPoolSize">20</prop>
    <prop key="hibernate.timeout">1800</prop>
    <prop key="hibernate.max_statement">50</prop>
    </props>
    </property>

    <property name="mappingLocations">
    <list>
    <value>
    classpath:com/holland/poison/business/domain/*.hbm.xml
    </value>
    </list>
    </property>


    </bean>

    <bean name="outletSchedulerService"
    class="org.springframework.scheduling.quartz.JobDe tailBean">
    <property name="jobClass"
    value="com.holland.poison.business.outlets.Outlets SchedulerJob" />
    <property name="jobDataAsMap">
    <map>
    <entry key="timeout" value="5" />
    </map>
    </property>
    </bean>

    <bean name="immediateSchedulerService"
    class="org.springframework.scheduling.quartz.JobDe tailBean">
    <property name="jobClass"
    value="com.holland.poison.business.outlets.Immedia teSchedulerJob" />
    <property name="jobDataAsMap">
    <map>
    <entry key="timeout" value="5" />
    </map>
    </property>
    </bean>

    <bean id="outletSchedulerServiceTrigger"
    class="org.springframework.scheduling.quartz.Simpl eTriggerBean">
    <property name="jobDetail" ref="outletSchedulerService" />
    <property name="startDelay" value="10000" />
    <property name="repeatInterval" value="60000" />
    </bean>

    <bean id="immediateSchedulerServiceTrigger"
    class="org.springframework.scheduling.quartz.Simpl eTriggerBean">
    <property name="jobDetail" ref="immediateSchedulerService" />
    <property name="startDelay" value="10000" />
    <property name="repeatInterval" value="120000" />
    </bean>

    <bean
    class="org.springframework.scheduling.quartz.Sched ulerFactoryBean">
    <property name="applicationContextSchedulerContextKey"
    value="applicationContext">
    </property>
    <property name="quartzProperties">
    <props>
    <!-- ThreadPool -->
    <prop key="org.quartz.threadPool.class">org.quartz.simpl .SimpleThreadPool</prop>
    <prop key="org.quartz.threadPool.threadCount">5</prop>
    <prop key="org.quartz.threadPool.threadPriority">5</prop>
    </props>
    </property>
    <property name="triggers">
    <list>
    <ref bean="outletSchedulerServiceTrigger" />
    <ref bean="immediateSchedulerServiceTrigger" />
    </list>
    </property>
    </bean>

    This is the snippent where it gets stuck and does not return

    try {
    logger.debug("Entered saveOutletProcessedData Method :" );
    //getHibernateTemplate().save(outletProcessed);
    Session session = getSession();
    Transaction transaction = session.beginTransaction();

    session.saveOrUpdate(outletProcessed);
    session.flush();
    transaction.commit();
    session.close();
    logger.debug("Exiting saveOutletProcessedData Method :" );
    } catch (Exception e) {
    e.printStackTrace();
    }


    Few lines form the log file

    DEBUG[2007-07-04 10:45:50,921] OutletProcessedDaoImpl.saveOutletProcessedData - Exiting saveOutletProcessedData Method :
    DEBUG[2007-07-04 10:45:50,937] LanguagesDaoImpl.findById - Language Found ! Language Id = 2
    DEBUG[2007-07-04 10:45:50,953] ObjectTypesDaoImpl.findObjectTypeByObjectTypeId - Object Type Found ! Type ID = 18
    DEBUG[2007-07-04 10:45:50,984] OutletProcessImpl.sendDataToFile - In sendDataToFile >>>>>>>>Object name : HotelLanguage Code : en_US
    DEBUG[2007-07-04 10:45:50,984] OutletProcessedDaoImpl.saveOutletProcessedData - Entered saveOutletProcessedData Method :
    DEBUG[2007-07-04 10:45:51,031] OutletProcessedDaoImpl.saveOutletProcessedData - Exiting saveOutletProcessedData Method :
    DEBUG[2007-07-04 10:45:51,031] LanguagesDaoImpl.findById - Language Found ! Language Id = 2
    DEBUG[2007-07-04 10:45:51,046] ObjectTypesDaoImpl.findObjectTypeByObjectTypeId - Object Type Found ! Type ID = 29
    DEBUG[2007-07-04 10:45:51,062] OutletProcessImpl.sendDataToFile - In sendDataToFile >>>>>>>>Object name : RestaurantLanguage Code : en_US
    DEBUG[2007-07-04 10:45:51,078] OutletProcessedDaoImpl.saveOutletProcessedData - Entered saveOutletProcessedData Method :

  • #2
    When you use declarative transaction management, you should not programmatically interfere. I.e. do not commit transactions or close sessions yourself. That could cause the connection pool to become exhausted permanently.

    And please use [ code] [ /code] tags to improve readability of your postings.

    Regards,
    Andreas

    Comment


    • #3
      Unable to insert more than 7 records

      I have commented the code for transaction. now i dont see any record being inserted in the database.

      Did i make a mistake here

      Code:
      try {
      		logger.debug("Entered saveOutletProcessedData Method :" );
      		//getHibernateTemplate().save(outletProcessed);
      		Session session = getSession();
      		//Transaction transaction = session.beginTransaction();
      		
      		session.saveOrUpdate(outletProcessed);
      		//session.flush();
      		//transaction.commit();
      		//session.close();
      		logger.debug("Exiting saveOutletProcessedData Method :" );
      		} catch (Exception e) {
      			e.printStackTrace();
      		}

      Comment


      • #4
        Unable to insert more than 7 records

        I have gone back to the original code but i am still stuck at the same place.

        Please see the output logs below

        Code:
        try {
        		logger.debug("Entered saveOutletProcessedData Method :" );
        		getHibernateTemplate().save(outletProcessed);
        logger.debug("Exiting saveOutletProcessedData Method :" );
        		} catch (Exception e) {
        			e.printStackTrace();
        		}
        Code:
        NFO[2007-07-04 11:56:50,000] ImmediateSchedulerJob.executeInternal - ======================================
        INFO[2007-07-04 11:56:50,000] ImmediateSchedulerJob.executeInternal - starting immediate scheduler
        INFO[2007-07-04 11:56:50,000] ImmediateSubscriptionServiceImpl.processTranslations - starting immediate scheduler - outlet size is : 3
        DEBUG[2007-07-04 11:56:50,140] 
        DEBUG[2007-07-04 11:56:50,421] LanguagesDaoImpl.findLanguageByCode - Language Found ! Language Id = nl_NL
        DEBUG[2007-07-04 11:56:50,421] LanguagesDaoImpl.findLanguageByCode - Language Found ! Language Id = en_US
        DEBUG[2007-07-04 11:56:50,468] LanguagesDaoImpl.findById - Language Found ! Language Id = 1
        DEBUG[2007-07-04 11:56:50,468] ObjectTypesDaoImpl.findObjectTypeByObjectTypeId - Object Type Found ! Type ID = 18
        DEBUG[2007-07-04 11:56:50,546] OutletProcessImpl.sendDataToFile - In sendDataToFile >>>>>>>>Object name : HotelLanguage Code : nl_NL
        DEBUG[2007-07-04 11:56:50,546] OutletProcessedDaoImpl.saveOutletProcessedData - Entered saveOutletProcessedData Method :
        DEBUG[2007-07-04 11:56:50,656] OutletProcessedDaoImpl.saveOutletProcessedData - Exiting saveOutletProcessedData Method :
        DEBUG[2007-07-04 11:56:50,671] LanguagesDaoImpl.findById - Language Found ! Language Id = 1
        DEBUG[2007-07-04 11:56:50,687] ObjectTypesDaoImpl.findObjectTypeByObjectTypeId - Object Type Found ! Type ID = 29
        DEBUG[2007-07-04 11:56:50,703] OutletProcessImpl.sendDataToFile - In sendDataToFile >>>>>>>>Object name : RestaurantLanguage Code : nl_NL
        DEBUG[2007-07-04 11:56:50,718] OutletProcessedDaoImpl.saveOutletProcessedData - Entered saveOutletProcessedData Method :
        DEBUG[2007-07-04 11:56:50,781] OutletProcessedDaoImpl.saveOutletProcessedData - Exiting saveOutletProcessedData Method :
        DEBUG[2007-07-04 11:56:50,796] LanguagesDaoImpl.findById - Language Found ! Language Id = 2
        DEBUG[2007-07-04 11:56:50,796] ObjectTypesDaoImpl.findObjectTypeByObjectTypeId - Object Type Found ! Type ID = 18
        DEBUG[2007-07-04 11:56:50,828] OutletProcessImpl.sendDataToFile - In sendDataToFile >>>>>>>>Object name : HotelLanguage Code : en_US
        DEBUG[2007-07-04 11:56:50,828] OutletProcessedDaoImpl.saveOutletProcessedData - Entered saveOutletProcessedData Method :
        DEBUG[2007-07-04 11:56:50,890] OutletProcessedDaoImpl.saveOutletProcessedData - Exiting saveOutletProcessedData Method :
        DEBUG[2007-07-04 11:56:50,890] LanguagesDaoImpl.findById - Language Found ! Language Id = 2
        DEBUG[2007-07-04 11:56:50,906] ObjectTypesDaoImpl.findObjectTypeByObjectTypeId - Object Type Found ! Type ID = 29
        DEBUG[2007-07-04 11:56:50,921] OutletProcessImpl.sendDataToFile - In sendDataToFile >>>>>>>>Object name : RestaurantLanguage Code : en_US
        DEBUG[2007-07-04 11:56:50,937] OutletProcessedDaoImpl.saveOutletProcessedData - Entered saveOutletProcessedData Method :
        DEBUG[2007-07-04 11:56:50,984] OutletProcessedDaoImpl.saveOutletProcessedData - Exiting saveOutletProcessedData Method :
        DEBUG[2007-07-04 11:56:50,984] OutletLogsDaoImpl.writeLog - save successful
        DEBUG[2007-07-04 11:56:51,000] OutletLogsDaoImpl.writeLog - save successful
        DEBUG[2007-07-04 11:56:51,000] OutletLogsDaoImpl.writeLog - save successful
        DEBUG[2007-07-04 11:56:51,093] OutletLogsDaoImpl.writeLog - save successful
        DEBUG[2007-07-04 11:56:51,265] LanguagesDaoImpl.findLanguageByCode - Language Found ! Language Id = nl_NL
        DEBUG[2007-07-04 11:56:51,265] LanguagesDaoImpl.findLanguageByCode - Language Found ! Language Id = en_US
        DEBUG[2007-07-04 11:56:51,281] LanguagesDaoImpl.findById - Language Found ! Language Id = 1
        DEBUG[2007-07-04 11:56:51,281] ObjectTypesDaoImpl.findObjectTypeByObjectTypeId - Object Type Found ! Type ID = 18
        DEBUG[2007-07-04 11:56:51,312] OutletProcessImpl.sendDataToFile - In sendDataToFile >>>>>>>>Object name : HotelLanguage Code : nl_NL
        DEBUG[2007-07-04 11:56:51,328] OutletProcessedDaoImpl.saveOutletProcessedData - Entered saveOutletProcessedData Method :
        DEBUG[2007-07-04 11:56:51,375] OutletProcessedDaoImpl.saveOutletProcessedData - Exiting saveOutletProcessedData Method :
        DEBUG[2007-07-04 11:56:51,390] LanguagesDaoImpl.findById - Language Found ! Language Id = 1
        DEBUG[2007-07-04 11:56:51,390] ObjectTypesDaoImpl.findObjectTypeByObjectTypeId - Object Type Found ! Type ID = 29
        DEBUG[2007-07-04 11:56:51,406] OutletProcessImpl.sendDataToFile - In sendDataToFile >>>>>>>>Object name : RestaurantLanguage Code : nl_NL
        DEBUG[2007-07-04 11:56:51,421] OutletProcessedDaoImpl.saveOutletProcessedData - Entered saveOutletProcessedData Method :
        DEBUG[2007-07-04 11:56:51,468] OutletProcessedDaoImpl.saveOutletProcessedData - Exiting saveOutletProcessedData Method :
        DEBUG[2007-07-04 11:56:51,484] LanguagesDaoImpl.findById - Language Found ! Language Id = 2
        DEBUG[2007-07-04 11:56:51,500] ObjectTypesDaoImpl.findObjectTypeByObjectTypeId - Object Type Found ! Type ID = 18
        DEBUG[2007-07-04 11:56:51,515] OutletProcessImpl.sendDataToFile - In sendDataToFile >>>>>>>>Object name : HotelLanguage Code : en_US
        DEBUG[2007-07-04 11:56:51,531] OutletProcessedDaoImpl.saveOutletProcessedData - Entered saveOutletProcessedData Method :
        DEBUG[2007-07-04 11:56:51,593] OutletProcessedDaoImpl.saveOutletProcessedData - Exiting saveOutletProcessedData Method :
        DEBUG[2007-07-04 11:56:51,593] LanguagesDaoImpl.findById - Language Found ! Language Id = 2
        DEBUG[2007-07-04 11:56:51,609] ObjectTypesDaoImpl.findObjectTypeByObjectTypeId - Object Type Found ! Type ID = 29
        DEBUG[2007-07-04 11:56:51,625] OutletProcessImpl.sendDataToFile - In sendDataToFile >>>>>>>>Object name : RestaurantLanguage Code : en_US
        DEBUG[2007-07-04 11:56:51,625] OutletProcessedDaoImpl.saveOutletProcessedData - Entered saveOutletProcessedData Method :

        Comment


        • #5
          Can you run your code in a debugger and find out where it actually hangs? Also try switching on hibernate logging to see if that does reveal more information.

          Besides that: I just spotted that you use a DBCP datasource but specify c3p0 parameters on the session factory configuration. That seems somewhat strange to me.

          Regards,
          Andreas

          Comment


          • #6
            Unable to insert more than 7 records

            As suggested I turned on hibernate logging. It was stuck at opening connetion. So I thought it ran out of connections. So I changed the property in the applicationContext.xml and it works now

            Code:
            <prop key="hibernate.connection.release_mode">after_statement</prop>
            				 <prop key="current_session_context_class">thread</prop>
            Is this the correct way to configure Spring and Hibernate. Please give your comments

            Code:
            <?xml version="1.0" encoding="UTF-8"?>
            <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
            <beans>
            	<bean id="propertyConfigurer"
            		class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
            		<property name="locations">
            			<list>
            				<value>classpath:jdbc.properties</value>
            			</list>
            		</property>
            	</bean>
            
            	<bean id="poisonDataSource"
            		class="org.apache.commons.dbcp.BasicDataSource">
            		<property name="driverClassName">
            			<value>${poison.jdbc.driverClassName}</value>
            		</property>
            		<property name="url">
            			<value>${poison.jdbc.url}</value>
            		</property>
            		<property name="username">
            			<value>${poison.jdbc.username}</value>
            		</property>
            		<property name="password">
            			<value>${poison.jdbc.password}</value>
            		</property>
            	</bean>
            	
            	<bean id="poisonTransactionManager"
            		class="org.springframework.orm.hibernate3.HibernateTransactionManager">
            		<!--		<property name="dataSource" ref="poisonDataSource"/> -->
            		<property name="sessionFactory" ref="poisonSessionFactory" />
            	</bean>
            
            	<bean id="nativeJdbcExtractor"
            		class="org.springframework.jdbc.support.nativejdbc.SimpleNativeJdbcExtractor"
            		lazy-init="true" />
            
            	<bean id="oracleLobHandler"
            		class="org.springframework.jdbc.support.lob.OracleLobHandler"
            		lazy-init="true">
            		<property name="nativeJdbcExtractor">
            			<ref local="nativeJdbcExtractor" />
            		</property>
            	</bean>
            
            	<bean id="poisonSessionFactory"
            		class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
            		<property name="dataSource">
            			<ref bean="poisonDataSource" />
            		</property>
            		<property name="lobHandler">
            			<ref bean="oracleLobHandler" />
            		</property>
            		
            		<property name="useTransactionAwareDataSource" value="true" />
            		<property name="hibernateProperties">
            			<props>
            				<prop key="hibernate.dialect">
            					${poison.hibernate.dialect}
            				</prop>
            				<prop key="hibernate.showSQL">true</prop>
            				 <prop key="hibernate.connection.release_mode">after_statement</prop>
            				 <prop key="current_session_context_class">thread</prop>
            				 
            				<prop key="hibernate.use_streams_for_binary">true</prop>
            				<prop key="hibernate.jdbc.batch_size">0</prop>
            				
            				<prop key="hibernate.timeout">1800</prop>
            				<prop key="hibernate.max_statement">50</prop>
            			</props>
            		</property>
            		
            		<property name="mappingLocations">
            			<list>
            				<value>
            					classpath:com/holland/poison/business/domain/*.hbm.xml
            				</value>
            			</list>
            		</property>
            		
            		
            	</bean>
            
            	<bean id="objectTypesDao"
            		class="com.holland.poison.business.common.dao.ObjectTypesDaoImpl">
            		<property name="sessionFactory">
            			<ref bean="poisonSessionFactory" />
            		</property>
            	</bean>
            	
            	
            	<bean name="outletSchedulerService"
            		class="org.springframework.scheduling.quartz.JobDetailBean">
            		<property name="jobClass"
            			value="com.holland.poison.business.outlets.OutletsSchedulerJob" />
            		<property name="jobDataAsMap">
            			<map>
            				<entry key="timeout" value="5" />
            			</map>
            		</property>
            	</bean>
            	
            	<bean name="immediateSchedulerService"
            		class="org.springframework.scheduling.quartz.JobDetailBean">
            		<property name="jobClass"
            			value="com.holland.poison.business.outlets.ImmediateSchedulerJob" />
            		<property name="jobDataAsMap">
            			<map>
            				<entry key="timeout" value="5" />
            			</map>
            		</property>
            	</bean>
            	
            	<bean id="outletSchedulerServiceTrigger"
            		class="org.springframework.scheduling.quartz.SimpleTriggerBean">
            		<property name="jobDetail" ref="outletSchedulerService" />
            		<property name="startDelay" value="10000" />
            		<property name="repeatInterval" value="60000" />
            	</bean>
            	
            	<bean id="immediateSchedulerServiceTrigger"
            		class="org.springframework.scheduling.quartz.SimpleTriggerBean">
            		<property name="jobDetail" ref="immediateSchedulerService" />
            		<property name="startDelay" value="10000" />
            		<property name="repeatInterval" value="120000" />
            	</bean>
            	
            	<bean
            		class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
            		<property name="applicationContextSchedulerContextKey"
            			value="applicationContext">
            		</property>
            		<property name="quartzProperties">
                 		 <props>
                   		 <!-- ThreadPool -->
                    	<prop key="org.quartz.threadPool.class">org.quartz.simpl.SimpleThreadPool</prop>
                    	<prop key="org.quartz.threadPool.threadCount">5</prop>
                    	<prop key="org.quartz.threadPool.threadPriority">5</prop>
            			</props>
            		</property>
            		<property name="triggers">
            			<list>
            				<ref bean="outletSchedulerServiceTrigger" />
            				<ref bean="immediateSchedulerServiceTrigger" />
            			</list>
            		</property>		
            	</bean>
            	
            	<bean id="OutletProcessImpl" class="com.holland.poison.business.outlets.OutletProcessImpl" singleton="false">
            		<property name="ftpConnectionTimeOut">
            			<value>100000</value>
            		</property>
            		<property name="httpConnectionTimeOut">
            			<value>10000</value>
            		</property>
            		<property name="outletArchiveDao">
            			<ref bean="outletArchiveDao"/>
            		</property>
            		<property name="translatedPoiDao">
            			<ref bean="translatedPoiDao"/>
            		</property>
            		<property name="languagesDao">
            			<ref bean="languagesDao" />
            		</property>
            		<property name="objectTypesDao">
            			<ref bean="objectTypesDao" />
            		</property>
            		<property name="outletProcessedDao">
            			<ref bean="outletProcessedDao" />
            		</property>
            		<property name="toBeProcessedDao">
            			<ref bean="toBeProcessedDao" />
            		</property>
            	</bean>
            	
            	<!--  Advice is the second most abundant thing in the universe after Hydrogen -->
            	<bean id="outletAdvice"
            		class="com.holland.poison.common.logging.OutletLoggingAdvice">
            		<property name="objectTypesDao" ref="objectTypesDao"/>
            		<property name="outletLogsDao" ref="OutletLogsDAO"/>
            	</bean>
            	
            	<bean id="poisonOutletSubscriptionProxy"
            		class="org.springframework.aop.support.NameMatchMethodPointcutAdvisor">
            		<property name="advice" ref="outletAdvice"/>
            		<property name="mappedNames">
            			<list>
            				<value>processOutlet</value>
            			</list>
            		</property>
            	</bean>	
            	
            	<bean id="requestService"
            		class="com.holland.poison.outlets.services.RequestOutletServiceImpl">
            	</bean>
            	
            	<bean id="outletRestartParser"
            		class="com.holland.poison.business.parser.OutletRestartParser">
            		<property name="outletProcessedDao">
            			<ref bean="outletProcessedDao" />
            		</property>
            	</bean>
            	
            	<bean id="outletParser"
            		class="com.holland.poison.business.parser.OutletParser">
            	</bean>
            	
            	<bean id="scheduledSubscriptionService"
            		class="com.holland.poison.outlets.services.ScheduledSubscriptionServiceImpl">
            		<property name="toBeProcessedDao">
            			<ref bean="toBeProcessedDao" />
            		</property>
            		<property name="outletProcess">
            			<ref bean="OutletProcessImpl"/>
            		</property>
            		<property name="outletProcessedDao">
            			<ref bean="outletProcessedDao" />
            		</property>
            		<property name="objectTypesDao">
            			<ref bean="objectTypesDao" />
            		</property>
            		<property name="languagesDao">
            			<ref bean="languagesDao" />
            		</property>
            		
            		<property name="outletParser">
            			<ref bean="outletParser" />
            		</property>
            		<property name="translationErrorCode">
            			<value>
            				<![CDATA[<Error>Tanslated xml Not found</Error>]]>
            			</value>
            		</property>
            	</bean>
            	
            	<bean id="immediateSubscriptionService"
            		class="com.holland.poison.outlets.services.ImmediateSubscriptionServiceImpl">
            		<property name="toBeProcessedDao">
            			<ref bean="toBeProcessedDao" />
            		</property>
            		<property name="outletProcessedDao">
            			<ref bean="outletProcessedDao" />
            		</property>
            		<property name="outletProcess">
            			<ref bean="OutletProcessImpl"/>
            		</property>
            		<property name="objectTypesDao">
            			<ref bean="objectTypesDao" />
            		</property>
            		<property name="languagesDao">
            			<ref bean="languagesDao" />
            		</property>
            		<property name="translationErrorCode">
            			<value>
            				<![CDATA[<Error>Tanslated xml Not found</Error>]]>
            			</value>
            		</property>
            	</bean>
            	
            	<bean id="RequestOutletServiceImpl" class="com.holland.poison.outlets.services.RequestOutletServiceImpl">
            		<property name="languagesDao">	
            			<ref bean="languagesDao"/>
            		</property>
            		<property name="objectTypesDao">
            			<ref bean="objectTypesDao" />
            		</property>
            		<property name="translatedPoiDao">
            			<ref bean="translatedPoiDao" />
            		</property>
            		<property name="languageErrorCode">
            				<value>
            					<![CDATA[<Error>LanguageCode not Found</Error>]]>
            				</value>
            		</property>
            		<property name="objectIdErrorCode">
            				<value>
            					<![CDATA[<Error>Invalid ObjectId</Error>]]>
            				</value>
            		</property>
            		<property name="objectTypeErrorCode">
            				<value>
            					<![CDATA[<Error>Object Type Not Found</Error>]]>
            				</value>
            		</property>
            		<property name="translationErrorCode">
            				<value>
            					<![CDATA[<Error>Tanslated xml Not found</Error>]]>
            				</value>
            		</property>
            	</bean>
            	
            	<bean id="autoProxyCreator"
            		class="org.springframework.aop.framework.autoproxy.DefaultAdvisorAutoProxyCreator" >
            		<property name="proxyTargetClass" value="true"></property>
            		</bean>
            </beans>

            Comment


            • #7
              I would use Spring's declarative transaction management around a service if possible. That way Spring will handle all this resource management for you. See the reference manual for details on this.

              I thought at first you did that, as you declare a TransactionManager, but this seems not to be the case.

              Releasing the connection after each statement seems to be curing the symptoms, but I suspect it will have performance implications.

              Regards,
              Andreas

              Comment

              Working...
              X