锘??xml version="1.0" encoding="utf-8" standalone="yes"?>国产精品国产精品国产专区不片,校园春色欧美,97se亚洲国产综合自在线观http://www.aygfsteel.com/chencao/archive/2007/08/08/135131.html闄堟搷闄堟搷Wed, 08 Aug 2007 00:27:00 GMThttp://www.aygfsteel.com/chencao/archive/2007/08/08/135131.htmlhttp://www.aygfsteel.com/chencao/comments/135131.htmlhttp://www.aygfsteel.com/chencao/archive/2007/08/08/135131.html#Feedback0http://www.aygfsteel.com/chencao/comments/commentRss/135131.htmlhttp://www.aygfsteel.com/chencao/services/trackbacks/135131.htmljava 浠g爜
  1. org.hibernate.exception.JDBCConnectionException: could not execute query   
  2.     at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:74)   
  3.     at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)   
  4.     .......   
  5. Caused by: com.mysql.jdbc.exceptions.MySQLNonTransientConnectionException: No operations allowed after connection closed.Connection was implicitly closed due to underlying exception/error:   
  6.   
  7.   
  8. ** BEGIN NESTED EXCEPTION **    
  9.   
  10. com.mysql.jdbc.CommunicationsException   
  11. MESSAGE: Communications link failure due to underlying exception:    
  12.   
  13. ** BEGIN NESTED EXCEPTION **    
  14.   
  15. java.net.SocketException   
  16. MESSAGE: Broken pipe   
  17.   
  18. STACKTRACE:   
  19.   
  20. java.net.SocketException: Broken pipe   
  21.     at java.net.SocketOutputStream.socketWrite0(Native Method)   
  22.     ......   
  23. ** END NESTED EXCEPTION **   

鏌ョ湅浜哅ysql鐨勬枃妗o紝浠ュ強Connector/J鐨勬枃妗d互鍙婂湪綰胯鏄庡彂鐜幫紝鍑虹幇榪欑寮傚父鐨勫師鍥犳槸錛?/p>

   Mysql鏈嶅姟鍣ㄩ粯璁ょ殑“wait_timeout”鏄?灝忔椂錛屼篃灝辨槸璇翠竴涓猚onnection絀洪棽瓚呰繃8涓皬鏃訛紝Mysql灝嗚嚜鍔ㄦ柇寮璇onnection銆傝繖灝辨槸闂鐨勬墍鍦紝鍦–3P0 pools涓殑connections濡傛灉絀洪棽瓚呰繃8灝忔椂錛孧ysql灝嗗叾鏂紑錛岃孋3P0騫朵笉鐭ラ亾璇onnection宸茬粡澶辨晥錛屽鏋滆繖鏃舵湁Client璇鋒眰connection錛孋3P0灝嗚澶辨晥鐨凜onnection鎻愪緵緇機lient錛屽皢浼氶犳垚涓婇潰鐨勫紓甯搞?/p>

瑙e喅鐨勬柟娉曟湁3縐嶏細

  1. 澧炲姞wait_timeout鐨勬椂闂淬?
  2. 鍑忓皯Connection pools涓璫onnection鐨刲ifetime銆?
  3. 嫻嬭瘯Connection pools涓璫onnection鐨勬湁鏁堟с?

褰撶劧鏈濂界殑鍔炴硶鏄悓鏃剁患鍚堜嬌鐢ㄤ笂榪?縐嶆柟娉曪紝涓嬮潰灝盌BCP鍜孋3P0鍒嗗埆鍋氫竴璇存槑錛屽亣璁緒ait_timeout涓洪粯璁ょ殑8灝忔椂

DBCP澧炲姞浠ヤ笅閰嶇疆淇℃伅:

  1. //set to 'SELECT 1'   
  2. validationQuery = "SELECT 1"  
  3. //set to 'true'   
  4. testWhileIdle = "true"    
  5. //some positive integer   
  6. timeBetweenEvictionRunsMillis = 3600000  
  7. //set to something smaller than 'wait_timeout'   
  8. minEvictableIdleTimeMillis = 18000000  
  9. //if you don't mind a hit for every getConnection(), set to "true"   
  10. testOnBorrow = "true"  

C3P0澧炲姞浠ヤ笅閰嶇疆淇℃伅:

  1. //set to 'SELECT 1'      
  2. preferredTestQuery = 'SELECT 1'    
  3.  //set to something much less than wait_timeout, prevents connections from going stale   
  4. idleConnectionTestPeriod = 18000     
  5. //set to something slightly less than wait_timeout, preventing 'stale' connections from being handed out   
  6. maxIdleTime = 25000    
  7. //if you can take the performance 'hit', set to "true"   
  8. testConnectionOnCheckout = true    

鏇村鐨勯厤緗俊鎭ぇ瀹跺彲浠ユ煡鐪婥3P0鏂囨。錛孋onnector/J鏂囨。錛屼互鍙奃BCP鐨勬枃妗c?/p>

闄堟搷 2007-08-08 08:27 鍙戣〃璇勮
]]>
主站蜘蛛池模板: 伊通| 岳阳县| 浑源县| 金塔县| 新河县| 油尖旺区| 阳江市| 梧州市| 永登县| 沽源县| 舞钢市| 独山县| 旬邑县| 乌兰县| 清水县| 洛浦县| 达州市| 都江堰市| 宁津县| 广东省| 什邡市| 安丘市| 叙永县| 木兰县| 中西区| 玛沁县| 湖南省| 昆山市| 贡觉县| 成武县| 马边| 余干县| 安龙县| 辽源市| 那曲县| 奇台县| 唐山市| 抚宁县| 三明市| 凤冈县| 贵州省|