Try to return the collection at the end of the method:

public Collection ejbFindAll() throws javax.ejb.FinderException {
                ArrayList a = new ArrayList();
                makeConnection();
                try{
                        String sqlString = "SELECT attributespk FROM " +
tableName;
                        PreparedStatement sqlStatement =
conn.prepareStatement(sqlString);

                        ResultSet sqlResults = sqlStatement.executeQuery();
                        AttributesKey key;
                        while(sqlResults.next()){
                                key = new
AttributesKey(sqlResults.getInt(1));
                                a.add(key);
                        }
                                        }catch(SQLException e){
                        throw new javax.ejb.EJBException(e);
                }finally{
                        dropConnection();
                }

                return a;
        }

Regards,

        Dimitar

-----Original Message-----
From: Rodel Pagui [mailto:rpagui@;INGENIUM.COM.PH]
Sent: Tuesday, November 05, 2002 7:24 PM
To: [EMAIL PROTECTED]
Subject: IllegalStateException

i have a BMP EJB that has a findAll() method.  this method returns all rows
from a table in my database.  by the way, i have a primary key class.  every

time i call the method in my web client, i keep on having the ff. exception:

RuntimeException; nested exception is: java.lang.IllegalStateException:
removing bean lock and it has tx set!Attributes
com.ingenium.ejbs.empeval.AttributesKey@5e9db7
java.rmi.ServerException: RuntimeException; nested exception is:
java.lang.IllegalStateException: removing bean lock and it has tx
set!Attributes com.ingenium.ejbs.empeval.AttributesKey@5e9db7

here is the code to my ejbFindAll() method:

public Collection ejbFindAll() throws javax.ejb.FinderException {
                ArrayList a = new ArrayList();
                makeConnection();
                try{
                        String sqlString = "SELECT attributespk FROM " +
tableName;
                        PreparedStatement sqlStatement =
conn.prepareStatement(sqlString);

                        ResultSet sqlResults = sqlStatement.executeQuery();
                        AttributesKey key;
                        while(sqlResults.next()){
                                key = new
AttributesKey(sqlResults.getInt(1));
                                a.add(key);
                        }
                        return a;
                }catch(SQLException e){
                        throw new javax.ejb.EJBException(e);
                }finally{
                        dropConnection();
                }
        }

thanks for any help you can give me.

==========================================================================To
unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to