Bugs item #767716, was opened at 2003-07-08 15:25
Message generated for change (Comment added) made by loubyansky
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=376685&aid=767716&group_id=22866

Category: JBossCMP
Group: v3.2
>Status: Closed
>Resolution: Fixed
Priority: 5
Submitted By: Julien Viet (cooperfbi)
>Assigned to: Alexey Loubyansky (loubyansky)
Summary: bad behaviour findByPK with null arg + commit A

Initial Comment:
when using a findByPrimaryKey(null) with commit option 
A (meanning cache), the query goes to the instance 
cache and it does not like it, throwing a 
IllegalStateException instead of having another 
behaviour (like ONFE or NPE)

the snippet CMPPersistenceManager#findEntity

if (finderMethod.getName().equals("findByPrimaryKey")
          && commitOption != 
ConfigurationMetaData.B_COMMIT_OPTION
          && commitOption != 
ConfigurationMetaData.C_COMMIT_OPTION)
  {
    Object key = ctx.getCacheKey();
    if (key == null)
    {
      key = ((EntityCache)con.getInstanceCache
()).createCacheKey(args[0]);
    }
    // the IllegalStateException is thrown when calling 
the line after
    if (con.getInstanceCache().isActive(key))
    {
      return key;
    }
  }

in addition here is a stacktrace excerpt :

java.lang.IllegalArgumentException: Requesting an 
object using a null key
at org.jboss.util.LRUCachePolicy.peek
(LRUCachePolicy.java:141)
        at 
org.jboss.ejb.plugins.AbstractInstanceCache.isActive
(AbstractInstanceCache.java:213)
        at 
org.jboss.ejb.plugins.CMPPersistenceManager.findEntity
(CMPPersistenceManager.java:305)
        at 
org.jboss.resource.connectionmanager.CachedConnection
Interceptor.findEntity
(CachedConnectionInterceptor.java:301)


----------------------------------------------------------------------

>Comment By: Alexey Loubyansky (loubyansky)
Date: 2003-07-09 18:45

Message:
Logged In: YES 
user_id=543482

Fixed in Branch_3_2.
Despite of commit option chosen, in case of null argument an 
IllegalArgumentException is thrown.

alex

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=376685&aid=767716&group_id=22866


-------------------------------------------------------
This SF.Net email sponsored by: Parasoft
Error proof Web apps, automate testing & more.
Download & eval WebKing and get a free book.
www.parasoft.com/bulletproofapps
_______________________________________________
JBoss-Development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to