關於jboss下部署webservice而出現資料庫down掉的問題

czhjdon發表於2011-04-15
各位jdon的技術朋友,我有個技術上的問題向大家虛心請教,我遇到的問題是這樣的:
我們在單位裡寫了一個類似提供給第三方提交簡訊資料的介面.介面形式是webservice,採用的技術框架是spring+hibernate+axis.


web.xml的配置檔案如下

<?xml version="1.0" encoding="ISO-8859-1"?>
<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<display-name>sms</display-name>

<context-param>
<param-name>log4jConfigLocation</param-name>
<param-value>/WEB-INF/log4j.properties</param-value>
</context-param>

<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/applicationContext.xml</param-value>
</context-param>
<!--
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/applicationContext_hibernate.xml /WEB-INF/applicationContext_service.xml</param-value>
</context-param>
-->
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>

<servlet>
<servlet-name>SpringLog4jConfigServlet</servlet-name>
<servlet-class>org.springframework.web.util.Log4jConfigServlet</servlet-class>
</servlet>

<servlet>
<servlet-name>AxisServlet</servlet-name>
<servlet-class>
org.apache.axis.transport.http.AxisServlet
</servlet-class>
<load-on-startup>2</load-on-startup>
</servlet>

<servlet-mapping>
<servlet-name>AxisServlet</servlet-name>
<url-pattern>/services/*</url-pattern>
</servlet-mapping>

<session-config>
<session-timeout>60</session-timeout>
</session-config>

<welcome-file-list>
<welcome-file>default.html</welcome-file>
</welcome-file-list>

</web-app>


applicationContext.xml配置檔案
<?xml version="1.0" encoding="UTF-8"?>
<beans
xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
<bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations">
<list>
<value>classpath:jdbc.properties</value>
<!--
<value>WEB-INF/mail.properties</value>
<value>WEB-INF/jdbc.properties</value>
-->
</list>
</property>
</bean>

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

<bean id="sessionFactory"
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="dataSource">
<ref local="dataSource" />
</property>

<property name="mappingResources">
<list>
<value>cn/gaoxt/model/map/JC_SCHOOL.hbm.xml</value>
<value>cn/gaoxt/model/map/SMS_RECEIVER.hbm.xml</value>
<value>cn/gaoxt/model/map/YHSJ_SYSADMINUSER.hbm.xml</value>
<value>cn/gaoxt/model/map/SMS_SENDSM.hbm.xml</value>
<value>cn/gaoxt/model/map/SMS_SENDCHECK.hbm.xml</value>
<value>cn/gaoxt/model/map/SMS_REVSM.hbm.xml</value>
<value>cn/gaoxt/model/map/YHSJ_STUDENT.hbm.xml</value>
</list>
</property>
<!--
<property name="mappingDirectoryLocations">
<list>
<value>WEB-INF/classes/cn/gaoxt/model/map</value>
<value>classpath:/my/package/</value>
</list>
</property>
-->
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">org.hibernate.dialect.Oracle10gDialect</prop>
</props>
</property>
</bean>

<bean id="transactionManager"
class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<property name="sessionFactory">
<ref local="sessionFactory" />
</property>
</bean>
<bean id="txProxyTemplate" abstract="true" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
<property name="transactionManager">
<ref bean="transactionManager" />
</property>
<property name="transactionAttributes">
<props>
<prop key="t_*">PROPAGATION_REQUIRED</prop>
</props>
</property>
</bean>

<bean id="gaoxtsmsinterfaceforschooldao" class="cn.gaoxt.dao.GaoxtSMSInterfaceForSchoolDAOHibernate">
<property name="sessionFactory" ref="sessionFactory"/>
</bean>

<bean id="gaoxtsmsinterfaceforshcool" class="cn.gaoxt.service.GaoxtSMSInterfaceForSchoolImpl">
<property name="gaoxtsmsinterfaceforschooldao" ref="gaoxtsmsinterfaceforschooldao"/>
</bean>
</beans>


現在的問題是,該介面被使用者介面後,大約過3-4左右.我們資料庫(oracle)就down掉.導致連線異常失敗.請問大家能不能幫我看一下這個問題,幫我想想主要是什麼原因造成的.鄙人非常感激.如果有好的最佳化意見,可以聯絡我,我的qq:271761293,

相關文章