那位高手可以帮解答下这个问题?
问题描述如下:
select machine, count(*)as cnt,status
from v$session
where username = 'SR'
and status = 'INACTIVE'
group by machine,status
order by cnt desc;
1 CRMAPP3 393 INACTIVE
2 CRMAPP4 305 INACTIVE
3 CRMAPP2 235 INACTIVE
4 CRMAPP1 4 INACTIVE出现的连接数非常多,但是程序里面连接数据库是通过spring的配置文件连接的。请高手帮看看,这个配置文件之前一直没有动过。
<?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:jsbss.properties</value>
</list>
</property>
</bean>
<!--数据库连接-->
<bean id="storeDataSource" class="org.apache.commons.dbcp.BasicDataSource">
<property name="driverClassName">
<value>oracle.jdbc.driver.OracleDriver</value>
</property>
<property name="url">
<value>${storeDatabase}</value>
</property>
<property name="username">
<value>${storeUser}</value>
</property>
<property name="password">
<value>${storeUserPwd}</value>
</property>
<property name="maxActive">
<value>${maxActive}</value>
</property>
<property name="maxIdle">
<value>${maxIdle}</value>
</property>
<property name="minIdle">
<value>${minIdle}</value>
</property>
<property name="initialSize">
<value>${initialSize}</value>
</property>
</bean>
<bean id="crmJDBC"
class="org.springframework.jdbc.core.JdbcTemplate">
<constructor-arg>
<ref bean="storeDataSource" />
</constructor-arg>
</bean>
<!--数据库事务控制-->
<bean id="crmTransaction" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource">
<ref local="storeDataSource"/>
</property>
</bean>
<bean id="crmTxAttributes" class="org.springframework.transaction.interceptor.MatchAlwaysTransactionAttributeSource">
<property name="transactionAttribute">
<value>PROPAGATION_REQUIRED,-Exception,-bss.common.DAOException</value>
</property>
</bean>
<bean id="crmTxInterceptor" class="org.springframework.transaction.interceptor.TransactionInterceptor">
<property name="transactionManager">
<ref local="crmTransaction" />
</property>
<property name="transactionAttributeSource">
<ref local="crmTxAttributes" />
</property>
</bean>
<bean id="crmAutoProxyCreator" class="org.springframework.aop.framework.autoproxy.BeanNameAutoProxyCreator">
<property name="interceptorNames">
<value>crmTxInterceptor</value>
</property>
<property name="beanNames">
<list>
<value>*DAO</value>
<value>*Manager</value>
</list>
</property>
</bean>
<bean id="oracleLobHandler" class="org.springframework.jdbc.support.lob.OracleLobHandler">
<property name="nativeJdbcExtractor">
<ref local="nativeDbcpJdbcExtractor" />
</property>
</bean>
<bean id="nativeDbcpJdbcExtractor" class="org.springframework.jdbc.support.nativejdbc.CommonsDbcpNativeJdbcExtractor" />
<!--DAO注入-->
<bean id="operateTreeDAO" class="bss.crm.saleresource.dao.impl.OperateTreeDAOImpl">
<property name="crmJdbc">
<ref bean="crmJDBC" />
</property>
</bean>
<bean id="storeAssitDAO" class="bss.crm.saleresource.dao.impl.StoreAssitDAOImpl">
<property name="jdbc">
<ref bean="crmJDBC" />
</property>
</bean>
<bean id="storeInoutDAO" class="bss.crm.saleresource.dao.impl.StoreInoutDAOImpl">
<property name="jdbc">
<ref bean="crmJDBC" />
</property>
</bean>
<bean id="materialManagerDAO" class="bss.crm.saleresource.dao.impl.MaterialManagerDAOImpl">
<property name="crmJdbc">
<ref bean="crmJDBC" />
</property>
<property name="operateTreeDAO">
<ref bean="operateTreeDAO"/>
</property>
</bean>
<bean id="storeManagerDAO" class="bss.crm.saleresource.dao.impl.StoreManagerDAOImpl">
<property name="crmJdbc">
<ref bean="crmJDBC" />
</property>
</bean>
<bean id="applyDAO" class="bss.crm.saleresource.dao.impl.ApplyDAOImpl">
<property name="jdbc">
<ref bean="crmJDBC" />
</property>
</bean>
<bean id="inOutDAO" class="bss.crm.saleresource.dao.impl.InOutDAOImpl">
<property name="jdbc">
<ref bean="crmJDBC" />
</property>
<property name="lobHandler">
<ref bean="oracleLobHandler" />
</property>
<!--<property name="vcServiceIp">
<value>${valueCardServiceIp}</value>
</property>
--></bean>
<bean id="batchBusiDao" class="bss.crm.saleresource.dao.impl.BatBusiDaoImpl">
<property name="jdbcTemplate">
<ref bean="crmJDBC" />
</property>
<property name="lobHandler">
<ref bean="oracleLobHandler" />
</property>
<property name="storeInoutDAO">
<ref bean="storeInoutDAO" />
</property>
</bean>
<bean id="repairDAO" class="bss.crm.saleresource.dao.impl.RepairDAOImpl">
<property name="jdbc">
<ref bean="crmJDBC" />
</property>
</bean>
<bean id="inoutStorePrintDAO" class="bss.crm.saleresource.dao.impl.InoutStorePrintDAOImpl">
<property name="jdbc">
<ref bean = "crmJDBC"/>
</property>
</bean> <!--BMO注入-->
<bean id="operateTreeManager" class="bss.crm.saleresource.bmo.impl.OperateTreeImpl">
<property name="operateTreeDAO">
<ref bean="operateTreeDAO"/>
</property>
</bean>
<bean id="storeAssitManager" class="bss.crm.saleresource.bmo.impl.StoreAssitManagerImpl">
<property name="storeInoutDAO">
<ref bean="storeInoutDAO" />
</property>
<property name="storeAssitDAO">
<ref bean="storeAssitDAO" />
</property>
<!--<property name="inOutDAO">
<ref bean="inOutDAO"/>
</property>
--></bean>
<bean id="applyManager" class="bss.crm.saleresource.bmo.impl.ApplyManagerImpl">
<property name="storeInoutDAO">
<ref bean="storeInoutDAO"/>
</property>
<property name="applyDAO">
<ref bean="applyDAO"/>
</property>
</bean>
<bean id="inOutManager" class="bss.crm.saleresource.bmo.impl.InOutManagerImpl">
<property name="storeInoutDAO">
<ref bean="storeInoutDAO"/>
</property>
<property name="applyDAO">
<ref bean="applyDAO"/>
</property>
<property name="inOutDAO">
<ref bean="inOutDAO"/>
</property>
</bean>
<bean id="materialManager" class="bss.crm.saleresource.bmo.impl.MaterialManagerImpl">
<property name="materialManagerDAO">
<ref bean="materialManagerDAO"/>
</property>
<!--<property name="storeInoutDAO">
<ref bean="storeInoutDAO" />
</property>
--></bean>
<bean id="storeManager" class="bss.crm.saleresource.bmo.impl.StoreManagerImpl">
<property name="storeManagerDAO">
<ref bean="storeManagerDAO"/>
</property>
</bean>
<bean id="batchBusiManager" class="bss.crm.saleresource.bmo.impl.BatchBusiManagerImpl">
<property name="batchBusidao">
<ref bean="batchBusiDao" />
</property>
</bean>
<!--<bean id="repairManager" class="bss.crm.saleresource.bmo.impl.RepairManagerImpl">
<property name="repairDAO">
<ref bean="repairDAO"/>
</property>
<property name="storeInoutDAO">
<ref bean="storeInoutDAO" />
</property>
</bean>
--><bean id="jndiRSC" class="org.springframework.jndi.JndiTemplate">
<constructor-arg>
<props>
<prop key="java.naming.factory.initial">${NamingInitFactoryClass}</prop>
<prop key="java.naming.provider.url">${jndiRSC}</prop>
</props>
</constructor-arg>
</bean>
<bean id="jndiCO" class="org.springframework.jndi.JndiTemplate">
<constructor-arg>
<props>
<prop key="java.naming.factory.initial">${NamingInitFactoryClass}</prop>
<prop key="java.naming.provider.url">${jndiCO}</prop>
</props>
</constructor-arg>
</bean>
<bean id="rscService" class="org.springframework.ejb.access.SimpleRemoteStatelessSessionProxyFactoryBean" lazy-init="true">
<property name="jndiName">
<value>bss/resourcemanager/provide/RscService</value>
</property>
<property name="lookupHomeOnStartup">
<value>false</value>
</property>
<property name="refreshHomeOnConnectFailure">
<value>true</value>
</property>
<property name="jndiTemplate">
<ref local="jndiRSC" />
</property>
<property name="businessInterface">
<value>bss.crm.invoke.rsc.RscInvoke</value>
</property>
</bean>
<bean id="initSessionHttp" class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean">
<property name="serviceUrl">
<value>${sm.initSessionUrl}</value>
</property>
<property name="serviceInterface">
<value>bss.crm.saleresource.session.init.IsessionInit</value>
</property>
</bean>
<!-- 税控接口 -->
<bean id="infoSyncManager" class="org.springframework.ejb.access.SimpleRemoteStatelessSessionProxyFactoryBean" lazy-init="true">
<property name="jndiName">
<value>com/linkage/crm/infoservice/ejb/InfoSyncManager</value>
</property>
<property name="lookupHomeOnStartup">
<value>false</value>
</property>
<property name="refreshHomeOnConnectFailure">
<value>true</value>
</property>
<property name="jndiTemplate">
<ref local="jndiCO" />
</property>
<property name="businessInterface">
<value>com.linkage.crm.infoservice.bmo.InfoSyncManager</value>
</property>
</bean>
<bean id="printManager" class="bss.crm.saleresource.bmo.impl.PrintManagerImpl">
<property name="printDao">
<ref bean="inoutStorePrintDAO"/>
</property>
<property name="applyDAO">
<ref bean="applyDAO"/>
</property>
<property name="invoiceManager">
<ref bean="infoSyncManager"/>
</property>
</bean>
</beans>
问题描述如下:
select machine, count(*)as cnt,status
from v$session
where username = 'SR'
and status = 'INACTIVE'
group by machine,status
order by cnt desc;
1 CRMAPP3 393 INACTIVE
2 CRMAPP4 305 INACTIVE
3 CRMAPP2 235 INACTIVE
4 CRMAPP1 4 INACTIVE出现的连接数非常多,但是程序里面连接数据库是通过spring的配置文件连接的。请高手帮看看,这个配置文件之前一直没有动过。
<?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:jsbss.properties</value>
</list>
</property>
</bean>
<!--数据库连接-->
<bean id="storeDataSource" class="org.apache.commons.dbcp.BasicDataSource">
<property name="driverClassName">
<value>oracle.jdbc.driver.OracleDriver</value>
</property>
<property name="url">
<value>${storeDatabase}</value>
</property>
<property name="username">
<value>${storeUser}</value>
</property>
<property name="password">
<value>${storeUserPwd}</value>
</property>
<property name="maxActive">
<value>${maxActive}</value>
</property>
<property name="maxIdle">
<value>${maxIdle}</value>
</property>
<property name="minIdle">
<value>${minIdle}</value>
</property>
<property name="initialSize">
<value>${initialSize}</value>
</property>
</bean>
<bean id="crmJDBC"
class="org.springframework.jdbc.core.JdbcTemplate">
<constructor-arg>
<ref bean="storeDataSource" />
</constructor-arg>
</bean>
<!--数据库事务控制-->
<bean id="crmTransaction" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource">
<ref local="storeDataSource"/>
</property>
</bean>
<bean id="crmTxAttributes" class="org.springframework.transaction.interceptor.MatchAlwaysTransactionAttributeSource">
<property name="transactionAttribute">
<value>PROPAGATION_REQUIRED,-Exception,-bss.common.DAOException</value>
</property>
</bean>
<bean id="crmTxInterceptor" class="org.springframework.transaction.interceptor.TransactionInterceptor">
<property name="transactionManager">
<ref local="crmTransaction" />
</property>
<property name="transactionAttributeSource">
<ref local="crmTxAttributes" />
</property>
</bean>
<bean id="crmAutoProxyCreator" class="org.springframework.aop.framework.autoproxy.BeanNameAutoProxyCreator">
<property name="interceptorNames">
<value>crmTxInterceptor</value>
</property>
<property name="beanNames">
<list>
<value>*DAO</value>
<value>*Manager</value>
</list>
</property>
</bean>
<bean id="oracleLobHandler" class="org.springframework.jdbc.support.lob.OracleLobHandler">
<property name="nativeJdbcExtractor">
<ref local="nativeDbcpJdbcExtractor" />
</property>
</bean>
<bean id="nativeDbcpJdbcExtractor" class="org.springframework.jdbc.support.nativejdbc.CommonsDbcpNativeJdbcExtractor" />
<!--DAO注入-->
<bean id="operateTreeDAO" class="bss.crm.saleresource.dao.impl.OperateTreeDAOImpl">
<property name="crmJdbc">
<ref bean="crmJDBC" />
</property>
</bean>
<bean id="storeAssitDAO" class="bss.crm.saleresource.dao.impl.StoreAssitDAOImpl">
<property name="jdbc">
<ref bean="crmJDBC" />
</property>
</bean>
<bean id="storeInoutDAO" class="bss.crm.saleresource.dao.impl.StoreInoutDAOImpl">
<property name="jdbc">
<ref bean="crmJDBC" />
</property>
</bean>
<bean id="materialManagerDAO" class="bss.crm.saleresource.dao.impl.MaterialManagerDAOImpl">
<property name="crmJdbc">
<ref bean="crmJDBC" />
</property>
<property name="operateTreeDAO">
<ref bean="operateTreeDAO"/>
</property>
</bean>
<bean id="storeManagerDAO" class="bss.crm.saleresource.dao.impl.StoreManagerDAOImpl">
<property name="crmJdbc">
<ref bean="crmJDBC" />
</property>
</bean>
<bean id="applyDAO" class="bss.crm.saleresource.dao.impl.ApplyDAOImpl">
<property name="jdbc">
<ref bean="crmJDBC" />
</property>
</bean>
<bean id="inOutDAO" class="bss.crm.saleresource.dao.impl.InOutDAOImpl">
<property name="jdbc">
<ref bean="crmJDBC" />
</property>
<property name="lobHandler">
<ref bean="oracleLobHandler" />
</property>
<!--<property name="vcServiceIp">
<value>${valueCardServiceIp}</value>
</property>
--></bean>
<bean id="batchBusiDao" class="bss.crm.saleresource.dao.impl.BatBusiDaoImpl">
<property name="jdbcTemplate">
<ref bean="crmJDBC" />
</property>
<property name="lobHandler">
<ref bean="oracleLobHandler" />
</property>
<property name="storeInoutDAO">
<ref bean="storeInoutDAO" />
</property>
</bean>
<bean id="repairDAO" class="bss.crm.saleresource.dao.impl.RepairDAOImpl">
<property name="jdbc">
<ref bean="crmJDBC" />
</property>
</bean>
<bean id="inoutStorePrintDAO" class="bss.crm.saleresource.dao.impl.InoutStorePrintDAOImpl">
<property name="jdbc">
<ref bean = "crmJDBC"/>
</property>
</bean> <!--BMO注入-->
<bean id="operateTreeManager" class="bss.crm.saleresource.bmo.impl.OperateTreeImpl">
<property name="operateTreeDAO">
<ref bean="operateTreeDAO"/>
</property>
</bean>
<bean id="storeAssitManager" class="bss.crm.saleresource.bmo.impl.StoreAssitManagerImpl">
<property name="storeInoutDAO">
<ref bean="storeInoutDAO" />
</property>
<property name="storeAssitDAO">
<ref bean="storeAssitDAO" />
</property>
<!--<property name="inOutDAO">
<ref bean="inOutDAO"/>
</property>
--></bean>
<bean id="applyManager" class="bss.crm.saleresource.bmo.impl.ApplyManagerImpl">
<property name="storeInoutDAO">
<ref bean="storeInoutDAO"/>
</property>
<property name="applyDAO">
<ref bean="applyDAO"/>
</property>
</bean>
<bean id="inOutManager" class="bss.crm.saleresource.bmo.impl.InOutManagerImpl">
<property name="storeInoutDAO">
<ref bean="storeInoutDAO"/>
</property>
<property name="applyDAO">
<ref bean="applyDAO"/>
</property>
<property name="inOutDAO">
<ref bean="inOutDAO"/>
</property>
</bean>
<bean id="materialManager" class="bss.crm.saleresource.bmo.impl.MaterialManagerImpl">
<property name="materialManagerDAO">
<ref bean="materialManagerDAO"/>
</property>
<!--<property name="storeInoutDAO">
<ref bean="storeInoutDAO" />
</property>
--></bean>
<bean id="storeManager" class="bss.crm.saleresource.bmo.impl.StoreManagerImpl">
<property name="storeManagerDAO">
<ref bean="storeManagerDAO"/>
</property>
</bean>
<bean id="batchBusiManager" class="bss.crm.saleresource.bmo.impl.BatchBusiManagerImpl">
<property name="batchBusidao">
<ref bean="batchBusiDao" />
</property>
</bean>
<!--<bean id="repairManager" class="bss.crm.saleresource.bmo.impl.RepairManagerImpl">
<property name="repairDAO">
<ref bean="repairDAO"/>
</property>
<property name="storeInoutDAO">
<ref bean="storeInoutDAO" />
</property>
</bean>
--><bean id="jndiRSC" class="org.springframework.jndi.JndiTemplate">
<constructor-arg>
<props>
<prop key="java.naming.factory.initial">${NamingInitFactoryClass}</prop>
<prop key="java.naming.provider.url">${jndiRSC}</prop>
</props>
</constructor-arg>
</bean>
<bean id="jndiCO" class="org.springframework.jndi.JndiTemplate">
<constructor-arg>
<props>
<prop key="java.naming.factory.initial">${NamingInitFactoryClass}</prop>
<prop key="java.naming.provider.url">${jndiCO}</prop>
</props>
</constructor-arg>
</bean>
<bean id="rscService" class="org.springframework.ejb.access.SimpleRemoteStatelessSessionProxyFactoryBean" lazy-init="true">
<property name="jndiName">
<value>bss/resourcemanager/provide/RscService</value>
</property>
<property name="lookupHomeOnStartup">
<value>false</value>
</property>
<property name="refreshHomeOnConnectFailure">
<value>true</value>
</property>
<property name="jndiTemplate">
<ref local="jndiRSC" />
</property>
<property name="businessInterface">
<value>bss.crm.invoke.rsc.RscInvoke</value>
</property>
</bean>
<bean id="initSessionHttp" class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean">
<property name="serviceUrl">
<value>${sm.initSessionUrl}</value>
</property>
<property name="serviceInterface">
<value>bss.crm.saleresource.session.init.IsessionInit</value>
</property>
</bean>
<!-- 税控接口 -->
<bean id="infoSyncManager" class="org.springframework.ejb.access.SimpleRemoteStatelessSessionProxyFactoryBean" lazy-init="true">
<property name="jndiName">
<value>com/linkage/crm/infoservice/ejb/InfoSyncManager</value>
</property>
<property name="lookupHomeOnStartup">
<value>false</value>
</property>
<property name="refreshHomeOnConnectFailure">
<value>true</value>
</property>
<property name="jndiTemplate">
<ref local="jndiCO" />
</property>
<property name="businessInterface">
<value>com.linkage.crm.infoservice.bmo.InfoSyncManager</value>
</property>
</bean>
<bean id="printManager" class="bss.crm.saleresource.bmo.impl.PrintManagerImpl">
<property name="printDao">
<ref bean="inoutStorePrintDAO"/>
</property>
<property name="applyDAO">
<ref bean="applyDAO"/>
</property>
<property name="invoiceManager">
<ref bean="infoSyncManager"/>
</property>
</bean>
</beans>
解决方案 »
- 怎么在创建表时定义外键?
- 分区表,本地索引,查询问题
- 存储过程 多条件组合查询
- (求助)Oracle 9i ---->SQL server
- 怎样在oracle中设置,才能使用第三方提供的java加解密函数?
- oracle: select a,b from xxtable 记录有5千万条,结果会怎样?
- 求sql语句,如何把图片写到oracle数据库中啊。
- 这样写游标能与查询的顺序对得上吗?老是提示文字与格式字符串不匹配,检查过几次,该是日期的就是日期的啦
- 如何改一个用户的密码
- 在线等待:在exp,imp 中如何指定要操作的数据库
- 抛砖引玉 数据的删除 什么事怕思考
- 关于数据库大批量操作慢的问题,跪请各位大大帮忙看看。
<value>${minIdle}</value>
</property>
<property name="initialSize">
<value>${initialSize}</value>
</property>这两个值是否设置的太高了,上面这个是指最小的空闲数,后面一个是初始化的时候产生多少数量
配置文件中设置的连接数是定的,只是你查询查来连接数很多,
看看你程序中是否每次释放连接了 connect.close
到J2EE版块去问下呢?
我好久没碰过SSH了,菜鸟了。