커넥션설정 보완작업 #51
@@ -341,24 +341,33 @@ public class CommonService extends BaseService {
|
||||
* @param fileMap
|
||||
*/
|
||||
public void setFileDownloadLog(HttpServletRequest request, Map fileMap){
|
||||
HttpSession session = request.getSession();
|
||||
PersonBean person = (PersonBean)session.getAttribute(Constants.PERSON_BEAN);
|
||||
|
||||
String objId = CommonUtils.createObjId();
|
||||
String systemName = Constants.SYSTEM_NAME;
|
||||
String userId = CommonUtils.checkNull(person.getUserId());
|
||||
String fileObjId = CommonUtils.checkNull(fileMap.get("OBJID"));
|
||||
String remoteAddr = CommonUtils.checkNull(request.getRemoteAddr());
|
||||
|
||||
Map paramMap = new HashMap();
|
||||
paramMap.put("objId", objId);
|
||||
paramMap.put("systemName", systemName);
|
||||
paramMap.put("userId", userId);
|
||||
paramMap.put("fileObjId", fileObjId);
|
||||
paramMap.put("remoteAddr", remoteAddr);
|
||||
|
||||
SqlSession sqlSession = SqlMapConfig.getInstance().getSqlSession();
|
||||
sqlSession.insert("common.insertFileDownloadLog", paramMap);
|
||||
SqlSession sqlSession = null;
|
||||
try{
|
||||
HttpSession session = request.getSession();
|
||||
PersonBean person = (PersonBean)session.getAttribute(Constants.PERSON_BEAN);
|
||||
|
||||
String objId = CommonUtils.createObjId();
|
||||
String systemName = Constants.SYSTEM_NAME;
|
||||
String userId = CommonUtils.checkNull(person.getUserId());
|
||||
String fileObjId = CommonUtils.checkNull(fileMap.get("OBJID"));
|
||||
String remoteAddr = CommonUtils.checkNull(request.getRemoteAddr());
|
||||
|
||||
Map paramMap = new HashMap();
|
||||
paramMap.put("objId", objId);
|
||||
paramMap.put("systemName", systemName);
|
||||
paramMap.put("userId", userId);
|
||||
paramMap.put("fileObjId", fileObjId);
|
||||
paramMap.put("remoteAddr", remoteAddr);
|
||||
|
||||
sqlSession = SqlMapConfig.getInstance().getSqlSession();
|
||||
sqlSession.insert("common.insertFileDownloadLog", paramMap);
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
}finally{
|
||||
if(sqlSession != null){
|
||||
sqlSession.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -5,10 +5,24 @@
|
||||
|
||||
<!-- 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="-1"/>
|
||||
maxTotal="200" maxIdle="50" maxWaitMillis="10000"
|
||||
testOnBorrow="true" validationQuery="SELECT 1"
|
||||
removeAbandonedOnBorrow="true" removeAbandonedTimeout="60"
|
||||
logAbandoned="true"/>
|
||||
|
||||
</Context>
|
||||
Reference in New Issue
Block a user