- 이 문서는 오라클클럽에서 작성하였습니다.
- 이 문서를 다른 블로그나 홈페이지에 게재하실 경우에는 출처를 꼭 밝혀 주시면 고맙겠습니다.~^^
- 출처 : http://www.gurubee.net/display/SWDEV/OSCache?
- 오라클클럽 지식창고의 모든 문서는 크리에이티브 커먼즈의 저작자표시-비영리-동일조건변경허락(BY-NC-SA) 라이선스에 따라 자유롭게 사용할 수 있습니다.
OSCache
1. What is OSCache
- OSCache는 JSP caching, Reqeust caching, DB Data caching등의 캐쉬 기능을 지원하는 framework입니다.
- OSCache는 기본적으로 memory를 cache storage로 활용하고 하지만, persistence를 위해 disk를 활용할 수 도 있습니다.
2. 설치
- ① OSCache download : https://oscache.dev.java.net/servlets/ProjectDocumentList
- ② oscache.jar 파일을 /WEB-INF/lib 디렉토리에 복사한다.
- ③ oscache.properties 파일을 /WEB-INF/classes/ 디렉토리에 복사한다.
3. OSCache 사용 예제
- OSCache 참고 URL
- iBatis 에서 OSCache
- iBatis cache 참고 : http://blog.naver.com/jooyong3?Redirect=Log&logNo=40036659474
<cacheModel id="emp-cache" type="OSCACHE"> <flushInterval minutes="60"/> </cacheModel> <select id="selectEmpList" parameterClass="int" resultClass="emp" cacheModel="emp-cache" > SELECT * FROM emp WHERE deptno=#deptno# </select>
- POJO Caching
String myKey = "myKey"; String myValue; int myRefreshPeriod = 1000; try { // Get from the cache myValue = (String) admin.getFromCache(myKey, myRefreshPeriod); } catch (NeedsRefreshException nre) { try { // Get the value (probably from the database) myValue = "This is the content retrieved."; // Store in the cache admin.putInCache(myKey, myValue); } catch (Exception ex) { // We have the current content if we want fail-over. myValue = (String) nre.getCacheContent(); // It is essential that cancelUpdate is called if the // cached content is not rebuilt admin.cancelUpdate(myKey); } }
문서에 대하여
- 최초작성자 : 김정식
- 최초작성일 : 2007년 11월 07일
문서정보
- 이 문서는 오라클클럽에서 작성하였습니다.
- 이 문서를 다른 블로그나 홈페이지에 게재하실 경우에는 출처를 꼭 밝혀 주시면 고맙겠습니다.~^^
- 출처 : http://www.gurubee.net/display/SWDEV/OSCache?
- 오라클클럽 지식창고의 모든 문서는 크리에이티브 커먼즈의 저작자표시-비영리-동일조건변경허락(BY-NC-SA) 라이선스에 따라 자유롭게 사용할 수 있습니다.

