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

Category: JBossCMP
Group: v3.2
Status: Open
Resolution: None
Priority: 5
Submitted By: Julien Viet (cooperfbi)
Assigned to: Nobody/Anonymous (nobody)
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)


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

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


-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100006ave/direct;at.asp_061203_01/01
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to