프로그래밍/Spring (jsp)
org.mariadb.jdbc.internal.util.dao.QueryException: Could not read resultset: unexpected end of stream, read 0 bytes from 4
Crazy_Kong
2017. 3. 7. 08:47
오류
org.mariadb.jdbc.internal.util.dao.QueryException: Could not read resultset: unexpected end of stream, read 0 bytes from 4 |
로컬에서 테스트 중 장시간 그냥 둔 상태로 있다 다시 접근하려하니 오류 발생..
디비에 오랜시간 접근이 없어서 커넥션이 끊어진 상태인듯..
해결
ValidationQuery = select 1 TestOnBorrow = true |
connection pool 설정에 해당 사항을 넣어 준다.
TestOnBorrow
connection pool 의 유효성 검사에 사용되고 validationQuery 를 수행하여 체크한다. 항상 체크하기 때문에 약간의 성능저하가 발생한다. |
TestWhileIdle
놀고 있는 connection pool 유효성 검사에 사용 default = false |
TimeBetweenEvictionRunsMillis
놀고 있는 connection pool 제거하는 시간 설정 디폴트 1/1000초 TimeBetweenEvictionRunsMillis = 130000 |