关于jboss下部署webservice而出现数据库down掉的问题

11-04-15 czhjdon

各位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,