0 Replies Latest reply on Jul 23, 2003 2:41 PM by mefesto78

    Commit Option A/B Making code behave differently

    mefesto78

      Hello,

      I just recently turned commit-option to A. After doing this I began to receive NullPointerExceptions in a session facade method with the code looking like the following.

      ===
      try{
      someObjectLocal = someObjectHome.findByPrimaryKey(data.getId());
      }catch(FinderException e){
      someObjectLocal = someObjectHome.create(data);
      }
      ===

      When I am using commit-option B, this code works fine when data.getId() == null, but when i switch to commit-option A, instead of getting a FinderException thrown -- I get a NullPointerException thrown.

      I looked in the ejb 2.0 spec to see what the behavior should be but it didn't really shed any light. Shouldn't it be that if a null is past into this finder method that it should still throw a FinderException and not a NullPointerException? Whatever it should do, shouldn't it behave exactly the same regardless of the commit-option I am using?

      Allen