??????? 隨著春節的結束,新的一年就這樣在一身的疲憊中開始了,回想過去的一年,我對軟件開發這個行業有所理解,對我技術的成長還算滿意,對待遇也算滿意,唯一不滿意的是我感覺在過去的一年我墮落了。回到租住的屋里從來不看書,也不開電腦,就是看電視,無聊的不行就做個飯,感覺是在吃老本啊!在這新的一年里有很多打算,報個英語班,學習日常用語,在自己的技術方面再有所提高,就好了,奢望不多,但愿都能做好!
2. 查是哪一個SID,通過SID可知道是哪個SESSION.
查V$ACCESS視圖:
3. 查出SID和SERIAL#
查V$SESSION視圖:
4. 殺進程
(1).先殺ORACLE進程:
window.showModalDialog('areaAdd.jsp",window,'dialogWidth:245px;dialogHeight:210px;status:no;help:no;scroll:no;');
其中window參數如果是需要頁面間傳值就必須要,否則可為空。父子頁面之間通訊也需要該參數。主頁面的iframe名稱為areaIframe,子頁面名稱為areaAdd,父頁面通知子頁面刷新用:areasIframe.location.href='areaIframe.jsp'。子頁面通知父頁面刷新使用:window.dialogArguments.areasIframe.areasReload();其中areasReload()是子頁面中的javascript方法
經過N多試驗,終于自己把這個問題搞定了。
網上關于C3P0在spring中的配置,幾乎沒有完全正確的(至少我還沒發現)。查了c3p0的文檔,又試驗過N次。得出如下配置是正確的:
<bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource"? ?destroy-method="close">
? ?? ?? ?<property name="driverClass"><value>${jdbc.driverClassName}</value></property>
? ?? ?? ?<property name="jdbcUrl"><value>${jdbc.url}</value></property>? ?? ?? ?? ?? ?
? ?? ?? ?<property name="user"><value>${jdbc.username}</value></property>
? ?? ?? ?<property name="password"><value>${jdbc.password}</value></property>
? ?? ?? ?
? ?? ?? ?<property name="minPoolSize"><value>1</value></property>
? ?? ?? ?<property name="maxPoolSize"><value>20</value></property>
? ?? ?? ?<property name="maxIdleTime"><value>1800</value></property>
? ?? ?? ?<property name="acquireIncrement"><value>2</value></property>
? ?? ?? ?<property name="maxStatements"><value>0</value></property>
? ?? ?? ?<property name="initialPoolSize"><value>2</value></property>
? ?? ?? ?<property name="idleConnectionTestPeriod"><value>1800</value></property>
? ?? ?? ?<property name="acquireRetryAttempts"><value>30</value></property>
? ?? ?? ?<property name="breakAfterAcquireFailure"><value>true</value></property>
? ?? ?? ?<property name="testConnectionOnCheckout"><value>false</value></property>
? ?? ?? ?
? ?? ?? ?<!--
? ?? ?? ?? ?<property name="properties">
? ?? ?? ? <props>? ?? ?? ?? ???
? ?? ?? ?? ???<prop key="c3p0.minPoolSize">1</prop>
? ?? ?? ?? ???<prop key="c3p0.maxPoolSize">10</prop>
? ?? ?? ?? ???<prop key="c3p0.maxIdleTime">1800</prop>? ?? ?? ?? ???
? ?? ?? ?? ???<prop key="c3p0.acquireIncrement">2</prop>
? ?? ?? ?? ???<prop key="c3p0.maxStatements">0</prop>
? ?? ?? ?? ?? ?? ???<prop key="c3p0.initialPoolSize">2</prop>
? ?? ?? ?? ???<prop key="c3p0.idleConnectionTestPeriod">1800</prop>
? ?? ?? ?? ???<prop key="c3p0.acquireRetryAttempts">30</prop>
? ?? ?? ?? ???<prop key="c3p0.breakAfterAcquireFailure">true</prop>
? ?? ?? ?? ???<prop key="c3p0.testConnectionOnCheckout">true</prop>
? ?? ?? ?? ???<prop key="user">root</prop>
? ?? ?? ?? ???<prop key="password">999999</prop>
? ?? ?? ?? ???
? ?? ?? ? </props>
? ?? ?? ?</property>
? ?? ???-->? ?? ?
</bean>
<!-- Hibernate SessionFactory -->
<bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
??<property name="dataSource" ref="dataSource"/>
??<property name="mappingDirectoryLocations">
? ?? ?<list>
? ?<value>classpath:/com/licaionline/domain/</value>
? ?? ?</list>
??</property>
??<property name="hibernateProperties">
? ?<props>
? ? <prop key="hibernate.dialect">org.hibernate.dialect.MySQLDialect</prop>
? ???<prop key="hibernate.show_sql">true</prop>
? ? <prop key="hibernate.generate_statistics">true</prop>
? ?? ?? ?? ?? ? <prop key="hibernate.connection.release_mode">auto</prop>? ?? ?? ?? ?? ?? ?? ?
? ?? ?? ?? ?? ? <prop key="hibernate.autoReconnect">true</prop>
? ?? ?? ?? ?? ? <prop key="hibernate.cglib.use_reflection_optimizer">true</prop>
? ?? ?? ?? ?? ? <!--
? ? <prop key="hibernate.useUnicode"></prop>
? ? <prop key="hibernate.characterEncoding"></prop>
? ? <prop key="hibernate.default-lazy-init"></prop>
? ?? ?? ?? ?? ? <prop key="hibernate.connection.provider_class">org.hibernate.connection.C3P0ConnectionProvider</prop>? ???
? ? -->
? ?? ?? ?? ?? ?? ?? ?? ?? ?? ???
? ?? ?? ?? ?? ? <!--
? ?? ?? ?? ?? ? <prop key="hibernate.c3p0.acquire_increment">2</prop>
? ?? ?? ?? ?? ? <prop key="hibernate.c3p0.idle_test_period">1800</prop>
? ?? ?? ?? ?? ? <prop key="hibernate.c3p0.timeout">1800</prop>
? ?? ?? ?? ?? ? <prop key="hibernate.c3p0.max_size">30</prop>
? ?? ?? ?? ?? ? <prop key="hibernate.c3p0.min_size">2</prop>
? ?? ?? ?? ?? ? <prop key="hibernate.c3p0.max_statements">50</prop>
? ? -->? ?? ?? ?
? ?</props>
??</property>
注意:注釋掉的那些,都是錯誤的。網上流行的,基本上跟注釋掉的那些差不多。配錯了,并無異常,還是能正常使用。但是所作的配置不起作用。
二、
起作用的,是datasource里面的這一句:
<property name="maxIdleTime"><value>1800</value></property>
這兒設置成每隔1800秒就掃描一次,檢查一下空閑的鏈接。所以,用戶基本上不會得到空閑的鏈接了。
如果再不放心,
<property name="testConnectionOnCheckout"><value>false</value></property>
這兒設置成true。每次連接之前,都要測一下。但是這樣會影響效率。
三、
解決的方法有3種:
增加wait_timeout的時間。
減少Connection pools中connection的lifetime。
測試Connection pools中connection的有效性。
當然最好的辦法是同時綜合使用上述3種方法,下面就DBCP和C3P0分別做一說明,假設wait_timeout為默認的8小時
DBCP增加以下配置信息:
//set to 'SELECT 1'? ?
validati? ?
//set to 'true'? ?
testWhileIdle = "true"? ???
//some positive integer? ?
timeBetweenEvictionRunsMillis = 3600000? ?
//set to something smaller than 'wait_timeout'? ?
minEvictableIdleTimeMillis = 18000000? ?
//if you don't mind a hit for every getConnection(), set to "true"? ?
test? ?
C3P0增加以下配置信息:
//set to 'SELECT 1'? ?? ?
preferredTestQuery = 'SELECT 1'? ???
//set to something much less than wait_timeout, prevents connections from going stale? ?
idleConnectionTestPeriod = 18000? ?? ?
//set to something slightly less than wait_timeout, preventing 'stale' connections from being handed out? ?
maxIdleTime = 25000? ???
//if you can take the performance 'hit', set to "true"? ?
testConnectionOnCheckout = true? ???
更多的配置信息大家可以查看C3P0文檔,Connector/J文檔,以及DBCP的文檔。
??????? 剛來這個公司的時候,軟件什么都沒有,都是重新做,可是忙壞了,經過三個月的努力算是小有成績了,下一步看能不能把portal的概念應用到我的統計平臺中,過兩天試試.......... 廢話幾句,沒什么好寫的
-start Eclipse with "eclipse.exe -vmargs -DR31ENHANCE=false". This will not