*
* @return collection
* @ejb.interface-method view-type="remote"
*/
public Collection processDefinitions() {
RequestScope scope = RequestLog.enterScope
(this, "processDefinitions", new Object[] {});
Collection definitions = new ArrayList();
Connection con = null;
PreparedStatement prepStmt = null;
ResultSet rs = null;
try {
try {
con = ds.getConnection();
prepStmt = con.prepareStatement
("SELECT PACKAGEID, PROCESSID FROM PROCESSDEFINITION ");
rs = prepStmt.executeQuery();
while (rs.next()) {
String pkgId = JDBCUtil.getString(ds, rs, 1);
String prcId = JDBCUtil.getString(ds, rs, 2);
try {
definitions.add (lookupProcessDefinition(pkgId, prcId));
} catch (InvalidKeyException e) {
logger.debug ("Couldn't find definition, propably"
+ " deleted since key lookup.");
}
}
} finally {
JDBCUtil.closeAll (rs, prepStmt, con);
}
} catch (SQLException se) {
throw new EJBException(se);
} catch (OptionalDataException ode) {
throw new EJBException(ode);
} catch (IOException ioe) {
throw new EJBException(ioe);
} finally {
scope.leave(definitions);
}
return definitions;
}