Hi,
I have two modules in my application.
The first one is a webservice. (Axis 1.1, spring 1.1.3 and Hibernate 2.1.6 ) This web service is responsible for
accessing the database.
The second one is web application which is consuming this web service. It does not do anything other than presentation.
The problem I am facing now is, when I request Hibernate for records in one table, it is executing so many queries.
It is fetching records from the tables which have foreign-key relation with that table. So when the web application is
using this web service, it is taking lot of time to load the page. ( 20 minutes just to display 5-6 records!!!!). I think this is because Axis is trying to (De)serialize all the objects that are retrieved from the database.
I tried keeping lazy="true" for all the associations. but by the time, the web appliction is accessing those associations, the session is getting closed causing "session closed exception" . but i am not opening or closing any sessions explicitly..spring is doint that for me. i do not want to tak any control on the sessions and i want to leave that to spring...
I know that this is a very common requirement and i am missing some basic thing...plz help as performance of my application is really very poor and unacceptable.
Following is my applicationContext.xml. i removed all the unwanted entries..
Thanks,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="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource"> <property name="driverClassName"> <value>${hibernate.connection.driver_class}</value> </property> <property name="url"> <value>${hibernate.connection.url}</value> </property> <property name="username"> <value>${hibernate.connection.username}</value> </property> <property name="password"> <value>${hibernate.connection.password}</value> </property> </bean> <!-- Hibernate SessionFactory --> <bean id="sessionFactory" class="org.springframework.orm.hibernate.LocalSessionFactoryBean"> <property name="dataSource"> <ref local="dataSource" /> </property> <property name="mappingResources"> <list> <value> com/sat/impl/MyWebService.hbm.xml </value> </list> </property> <property name="hibernateProperties"> <props> <prop key="hibernate.dialect"> ${hibernate.dialect} </prop> </props> </property> </bean> <!-- Transaction manager for a single Hibernate SessionFactory (alternative to JTA) --> <bean id="transactionManager" class="org.springframework.orm.hibernate.HibernateTransactionManager"> <property name="sessionFactory"> <ref local="sessionFactory" /> </property> </bean> <!-- Add DAOs here --> <bean id="roleDao" class="com.sat.dao.hibernate.HibernateRoleDAO"> <property name="sessionFactory"> <ref local="sessionFactory" /> </property> </bean> <bean id="ProductionService" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean"> <property name="transactionManager"> <ref local="transactionManager" /> </property> <property name="target"> <ref local="userManagerTarget" /> </property> <property name="transactionAttributes"> <props> <prop key="remove*">PROPAGATION_REQUIRED</prop> </props> </property> </bean> <bean id="userManagerTarget" class="com.sat.ProductionServiceImpl"> <property name="roleDao"> <ref local="roleDao" /> </property> </bean> </beans>
SSSS.


Reply With Quote