Tag Archives: Connection

Can not read response from server. Expected to read 4 bytes, read 0 bytes before connection was unexpectedly lost.

  mysql 접속시에 자꾸 아래와 같은 에러가 나서.. Can not read response from server. Expected to read 4 bytes, read 0 bytes before connection was unexpectedly lost. context.xml의 설정을 아래와 같이 바꿔주니 해결된듯하다. <Resource auth=”Container” driverClassName=”com.mysql.jdbc.Driver” url=”jdbc:mysql://xxx.xxx.xxx.xxx:3306/dbname?characterEncoding=utf-8&amp;interactiveClient=true&amp;autoReconnect=true&amp;autoReconnectForPools=true&amp;useUnicode=true&amp;characterSetResults=UTF-8″ type=”javax.sql.DataSource” name=”jdbc/xxxxx” username=”userid” … Continue reading

Posted in Database, Java/JSP | Tagged , , , , | Leave a comment

DBCP + JDBC(MySQL) 사용시 간혹 뜨는 Could not open JDBC Connection for transaction

  DBCP(Database Connection Pool)을 사용하다 보면 가끔씩 만나게 되는 에러가 있다. 내 추측에는 DBCP의 특성상 많은 수의 커넥션을 미리 맺어 놓고, 어플리케이션이 풀에서 커넥션을 빌려다 사용하고 환원하는 식인데, 맺어놓은 커넥션을 MySQL의 커넥터가 끊어버리는듯 하다. 그래서 풀에 정상적으로 요청을 하였지만 그것이 … Continue reading

Posted in Database, Java/JSP | Tagged , , , | Leave a comment

java.sql.SQLException Io exception: Connection reset

  Connection reset은 DB 서버측에서 커넥션이 종료되었으나 WAS는 그것을 알아차리지 못할때 발생합니다. TOMCAT의 경우 , evicator라는 것이 있어 정기적으로 비정상종료된 커넥션을 없애주는 옵션이 있습니다. 아래 스크립트를 참고하세요 – validationQuery=”SELECT 1 FROM DUAL” – testWhileIdle=”true” – timeBetweenEvictionRunsMillis=”3000″ <Resource name=”WmsPool” auth=”Container” type=”javax.sql.DataSource” … Continue reading

Posted in Database, Java/JSP, WEB/WAS | Tagged , , , , | Leave a comment

Cannot get a connection, pool exhausted

  ################################# Exception ############################# org.apache.commons.dbcp.SQLNestedException: Cannot get a connection, pool exhausted at org.apache.commons.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:103) at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:540) 위와 같은 증상에선..테스트 소스는 별 의미가 없습니다. 리소스(Connection)가 어디서 새는지 해당 소스를 찾아내시는 방법밖에 없습니다. 리뷰할 소스가 방대하고 성능관리 툴이 없는 상황이시라면 정말 위로의 말씀을 … Continue reading

Posted in Database, Java/JSP, WEB/WAS | Tagged , , | Leave a comment