Created
August 17, 2017 08:48
-
-
Save daemin-hwang/77106bf954aed0a915529989a40645e8 to your computer and use it in GitHub Desktop.
H2 DB file lock 문제
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
h2 db를 파일모드로 띄우게 되면 서로 다른 프로세스에서 엑세스 하려는 경우 에러가 발생한다. | |
가령 스프링 부트앱에서 | |
H2데이터소스를 물고 기동 시킨 상태에서 | |
리파지토리를 테스트 하는 테스트 코드가 수행된다면 위에 언급한 에러가 발생하게 된다. | |
커넥션 정보를 아래와 같이 변경하면 해결 된다. | |
`spring.datasource.url=jdbc:log4jdbc:h2:~/job_history;AUTO_SERVER=true` |
properties 파일을 저렇게 수정해도 안되는데 다른 방법이 있을까요?
위에서 url에 tcp가 없는 것을 확인할 수 있습니다. tcp가 없는 경우는 다중접속이 불가능합니다.
jdbc:log4jdbc:h2:tcp://localhost/~/job_history;AUTO_SERVER=true`
와 같이 사용하시면 사용가능할 것 같습니다.
오래된 글이고 지나가는 행인이지만 저도 같은 경험을 하고 있어서 적어드리고 갑니다.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
properties 파일을 저렇게 수정해도 안되는데 다른 방법이 있을까요?