天天看點

bbossgroups持久層架構資料源配置檔案執行個體

bbossgroups持久層架構資料源配置檔案執行個體,本配置包含了實體資料源stsmc的配置執行個體:

<?xml version="1.0" encoding="utf-8"?>

<poolman>

<datasource>

    <dbname>stsmc</dbname>
	<loadmetadata>false</loadmetadata>
    <jndiName>jdbc/mysql-ds</jndiName>
    <driver>com.mysql.jdbc.Driver</driver>

     <url>jdbc:mysql://172.16.33.46:3306/etl</url> 

    <username>root</username>
    <password>123456</password>

    <txIsolationLevel>READ_COMMITTED</txIsolationLevel>

    <nativeResults>true</nativeResults>

    <poolPreparedStatements>false</poolPreparedStatements>

    <initialConnections>2</initialConnections>
    
    <minimumSize>2</minimumSize>
    <maximumSize>10</maximumSize>
	<!--控制connection達到maximumSize是否允許再建立新的connection
		true:允許,預設值
		false:不允許-->
    <maximumSoft>false</maximumSoft>
    
    <!-- 
    是否檢測逾時連結(事務逾時連結)
    true-檢測,如果檢測到有事務逾時的連結,系統将強制回收(釋放)該連結
    false-不檢測,預設值
     -->
    <removeAbandoned>false</removeAbandoned>
	<!--
		連結使用逾時時間(事務逾時時間)
		機關:秒
	-->
    <userTimeout>50</userTimeout>
    <!-- 
    	系統強制回收連結時,是否輸出背景日志
    	true-輸出,預設值
    	false-不輸出
     -->
    <logAbandoned>true</logAbandoned>
    
    <!-- 
    	資料庫會話是否是readonly,預設為false
     -->
    <readOnly>false</readOnly>
	
	<!--
		對應屬性:timeBetweenEvictionRunsMillis
		the amount of time (in milliseconds) to sleep between examining idle objects for eviction 
	-->
	<skimmerFrequency>1200000</skimmerFrequency>
	<!--對應于minEvictableIdleTimeMillis 屬性:
	minEvictableIdleTimeMillis the minimum number of milliseconds 
	an object can sit idle in the pool before it is eligable for evcition
	機關:秒
	
	空閑連結回收時間,空閑時間超過指定的值時,将被回收
	-->
	<connectionTimeout>2400000</connectionTimeout>
	<!--
	numTestsPerEvictionRun 
	the number of idle objects to 
	examine per run within the idle object eviction thread (if any)
	
	每次回收的連結個數 
	-->
    <shrinkBy>5</shrinkBy>
    <!--
    /**
     * 檢測空閑連結處理時,是否對空閑連結進行有效性檢查控制開關
     * true-檢查,都檢查到有無效連結時,直接銷毀無效連結
     * false-不檢查,預設值
     */
     -->
    <testWhileidle>true</testWhileidle>


 、
    <!-- 請求連結時等待時間,機關:秒
    客服端程式請求連結等待時間超過指定值時,背景包等待逾時異常
     -->
    <maxWait>60</maxWait>
    
    <!-- 
    	連結有效性檢查sql語句
     -->
    <validationQuery>select 1</validationQuery>
    
    <autoprimarykey>false</autoprimarykey>
	<showsql>false</showsql>
	

  </datasource>

</poolman>
      

bboss持久層架構外部資料源配置方法請參考文章《

關于bboss-persistent持久層架構通過jndi引用外部資料源(datasource)

繼續閱讀