Bugs item #531090, was opened at 2002-03-17 14:45
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=376685&aid=531090&group_id=22866

Category: JBossCMP
Group: v3.0 Rabbit Hole
>Status: Closed
>Resolution: Invalid
Priority: 5
Submitted By: Jürgen Zeller (zetzet)
>Assigned to: Dain Sundstrom (dsundstrom)
Summary: entity returned by custom finder fails

Initial Comment:
I wrote a custom finder:
    public Collection ejbFindByPrimaryKeys(Collection 
pKeys) throws FinderException
    {
        Collection beans= new ArrayList(pKeys.size());
        e1Home     home = (e1Home) 
mEntityContext.getEJBLocalHome();

        for (Iterator i= pKeys.iterator(); i.hasNext
(); )
        {
            Integer key= (Integer)i.next();
            e1 bean= home.findByPrimaryKey(key);
            beans.add(bean);
        }

        return beans;
    }


The finder works, and returns the right beans
in the collection.

As soon any getter of a bean is accessed, the
getter fails with an SQLException:

2002-03-17 18:17:16,655 DEBUG 
[org.jboss.ejb.plugins.cmp.jdbc.JDBCLoadEntityCommand.e
1EJB] Executing SQL: SELECT b FROM TAB1 WHERE (a=?)
2002-03-17 18:17:16,655 TRACE 
[org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMP2xFieldBr
idge.e1EJB.a] Set parameter: index=1, 
jdbcType=INTEGER, value=e1EJB:10000100
2002-03-17 18:17:16,685 ERROR 
[org.jboss.ejb.plugins.LogInterceptor] 
TransactionRolledbackException, causedBy:
java.sql.SQLException: ERROR:  parser: parse error at 
or near ":"

The reason is somehow related to 
JDBCLoadEntityCommand, line 87
      ReadAheadCache.EntityReadAheadInfo info = 
         readAheadCache.getEntityReadAheadInfo
(ctx.getId());

ctx.getId() returns the bean object, but is
handeled as PK object afterwards

JBoss 3.0.0b2 CVS 2002-03-17 HEAD




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

>Comment By: Dain Sundstrom (dsundstrom)
Date: 2002-03-17 14:58

Message:
Logged In: YES 
user_id=251431

Custom finders need to return a collection of primary key 
objects.  You are returning actual entity beans.

All you need to do is return the pKeys collection that is 
passed in.

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

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

_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to