이 블로그 검색

2012년 4월 24일 화요일

RequestFactory delete후 JDOObjectNotFoundException 발생


RequestFactory는 항상 Proxcy의 유효성체크를 하는데 delete후에도 findEntity()함수를 호출하기에
삭제가 되버렸기에 오류가 남.
그래서 아래와 같이  RuntimeException 처리를 해 주면됨.


public static Message findMessage(Long id) {
                PersistenceManager pm = PMF.get().getPersistenceManager();

                try {
                        return pm.getObjectById(Message.class, id);
                } catch(RuntimeException e) {
                        return null;
                } finally {
                        pm.close();
                }
        }


참고 url
http://www.mail-archive.com/google-web-toolkit@googlegroups.com/msg56356.html
http://code.google.com/p/google-web-toolkit/issues/detail?id=6721#c3
http://stackoverflow.com/questions/9476341/requestfactory-theory-why-is-locator-find-being-called-so-often
http://www.mail-archive.com/google-web-toolkit@googlegroups.com/msg53586.html

댓글 없음:

댓글 쓰기