close

 

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" 
       xmlns:flex="http://www.springframework.org/schema/flex" 
       xmlns:context="http://www.springframework.org/schema/context"
       xmlns:tx="http://www.springframework.org/schema/tx"
       xmlns:p="http://www.springframework.org/schema/p" 
       xmlns:aop="http://www.springframework.org/schema/aop"
       xmlns:jee="http://www.springframework.org/schema/jee"
       xmlns:task="http://www.springframework.org/schema/task"       
       xsi:schemaLocation=" 
   http://www.springframework.org/schema/beans 
   http://www.springframework.org/schema/beans/spring-beans-3.0.xsd 
   http://www.springframework.org/schema/flex 
   http://www.springframework.org/schema/flex/spring-flex-1.0.xsd
   http://www.springframework.org/schema/context
   http://www.springframework.org/schema/context/spring-context-3.0.xsd
   http://www.springframework.org/schema/task 
   http://www.springframework.org/schema/task/spring-task-3.0.xsd
   http://www.springframework.org/schema/aop 
   http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
   http://www.springframework.org/schema/tx 
   http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
     http://www.springframework.org/schema/jee
       http://www.springframework.org/schema/jee/spring-jee-3.0.xsd
   ">
<!-- dataSource for Oracle JDBC 驅動 -->  
<bean id="dataSource" destroy-method="close">
<!-- 設定 JDBC DB DRIVER 驅動介面 --> 
        <property name="driverClassName" value="oracle.jdbc.driver.OracleDriver"/>
        <!-- 設定 JDBC DB URL 遠端主機連接路徑  --> 
        <property name="url" value="jdbc:oracle:thin:@192.168.2.21:1521:topprod"/>
        <!-- 設定 DB LOGIN USERNAME  --> 
        <property name="username" value="ds"/>
        <!-- 設定 DB LOGIN PASSWORD  --> 
        <property name="password" value="ds"/>
        <!-- DBCP 連接池啟動時的初始值 -->  
        <property name="initialSize" value="1"/>  
        <!-- DBCP 連接池的最大值 -->  
        <property name="maxActive" value="100"/>  
        <!--  最小空閒值.當空閒的連接數少於閥值時,連接池就會預申請去一些連接,以免來不及申請 -->  
        <property name="minIdle" value="1"/>  
        <!-- 最大空閒值.當經過一個高峰時間後,連接池可以慢慢將已經用不到的連接慢慢釋放一部分,一直減少到maxIdle為止 -->  
        <property name="maxIdle" value="10"/>  
</bean>
<!-- 交易管理模式 注入   JDBC --> 
<bean id = "transactionManager" class = "org.springframework.jdbc.datasource.DataSourceTransactionManager">   
<property name = "dataSource" ref="dataSource"/>   
</bean>   
<!-- 交易管理模式 注入   JDBC --> 
<bean id="transactionTemplate"> 
    <property name="transactionManager" ref="transactionManager"/>
</bean> 
<!-- 配置一個JdbcTemplate實例,並將這個「共享的」,「安全的」實例注入到不同的DAO類中去 -->  
<bean id = "jdbcTemplate"  class = "org.springframework.jdbc.core.JdbcTemplate">   
     <property name = "dataSource" ref="dataSource"/>   
</bean>
<!-- Flex Message Broker -->
<flex:message-broker services-config-path="/WEB-INF/flex/services-config.xml"/>

<bean/>

<bean id="_messageBroker " />   

<bean> 
<property name="mappings" value="/messagebroker/*=_messageBroker" /> 
</bean>
<!-- BLOB/CLOB 操作類  注入   JDBC --> 
<bean id="defaultLobHandler" lazy-init="true" />
   
<context:annotation-config />
<context:component-scan  base-package="com" />
<!--  
<tx:annotation-driven transaction-manager="transactionManager" /> 
-->
  
<bean id="DAOTarget">
  <property name="dataSource" ref="dataSource"/>
   <property name="lobHandler" ref="defaultLobHandler" />   
</bean>
<bean id="ObjectDAO">
    <property name="transactionManager" ref="transactionManager"/>
    <property name="target" ref="DAOTarget"/>
    <property name="proxyTargetClass" value="true"/> 
    <property name="transactionAttributes">    
      <props>
        <prop key="*">PROPAGATION_REQUIRED,-Exception</prop>
        <prop key="get*">PROPAGATION_SUPPORTS</prop>
      </props>
    </property>
      <flex:remoting-destination/>
  </bean>
  
</beans>

 

 

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 jeffreyhu 的頭像
    jeffreyhu

    傑佛瑞Blog TIPTOP ERP+ EasyFlow (BPM) + BI 系統整合開發經驗分享

    jeffreyhu 發表在 痞客邦 留言(0) 人氣()