I have a home method in my cmp entity bean 

public Page ejbHomeGetUsers(
                int offset,
                int limit)
                throws FinderException {

long userCount = ((Long) ejbSelectGeneric("SELECT COUNT( o.id ) FROM
User o ", new Object[0])        .iterator().next()).longValue();

Collection users = ejbSelectGeneric( "SELECT OBJECT( o ) FROM User o
OFFSET ?1 LIMIT ?2", new Object[] {new Integer(offset),new
Integer(limit)});

return new Page(users, userCount, offset);
}

There is a bug in jboss 3.2.x (confirmed for Jboss 3.2.2RC4 and
3.2.2Final) that causes the second call to ejbSelectGeneric to return a
collection of o.id elements instead of User objects.

When I changed the code that counts the elements to:
long userCount = ((Long) ejbSelectGeneric("SELECT OBJECT( o ) FROM User
o ", new Object[0])     .size();

Everything worked ok.

Is this a bug in Jboss or am I doing something wrong?


-------------------------------------------------------
This SF.net email sponsored by: Enterprise Linux Forum Conference & Expo
The Event For Linux Datacenter Solutions & Strategies in The Enterprise
Linux in the Boardroom; in the Front Office; & in the Server Room
http://www.enterpriselinuxforum.com
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to