28 lines
1.3 KiB
XML
28 lines
1.3 KiB
XML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<Context>
|
|
<!-- Default set of monitored resources -->
|
|
<WatchedResource>WEB-INF/web.xml</WatchedResource>
|
|
|
|
<!-- PLM DataSource JNDI Resource -->
|
|
<!-- Using environment variables for database connection -->
|
|
<!--
|
|
개선된 Connection Pool 설정 (커넥션 누수 방지):
|
|
- maxTotal: 최대 커넥션 수 (기본 200 유지)
|
|
- maxIdle: 유휴 커넥션 수 (기본 50 유지)
|
|
- maxWaitMillis: 커넥션 획득 대기 시간 (무한 대기 -> 10초로 제한)
|
|
- testOnBorrow: 커넥션 대여 시 유효성 검사
|
|
- validationQuery: 유효성 검사 쿼리
|
|
- removeAbandonedOnBorrow: 누수된 커넥션 자동 회수 활성화
|
|
- removeAbandonedTimeout: 60초 이상 사용 중인 커넥션 회수
|
|
- logAbandoned: 누수된 커넥션 로그 기록 (모니터링용)
|
|
-->
|
|
<Resource name="plm" auth="Container"
|
|
type="javax.sql.DataSource" driverClassName="org.postgresql.Driver"
|
|
url="${DB_URL}"
|
|
username="${DB_USERNAME}" password="${DB_PASSWORD}"
|
|
maxTotal="200" maxIdle="50" maxWaitMillis="10000"
|
|
testOnBorrow="true" validationQuery="SELECT 1"
|
|
removeAbandonedOnBorrow="true" removeAbandonedTimeout="60"
|
|
logAbandoned="true"/>
|
|
|
|
</Context> |