* (formally) invalid ids.
* @ejb.interface-method view-type="remote"
*/
public void removeProcessDefinition(String packageId, String processId)
throws InvalidKeyException {
RequestScope scope = RequestLog.enterScope
(this, "removeProcessDefinition",
new Object[] { packageId, processId });
try {
prepareForRemoval(packageId, processId);
PreparedStatement prepStmt = null;
Connection con = null;
ResultSet rs = null;
try {
String processType = packageId + "/" + processId;
uncacheDefinition (processType);
con = ds.getConnection();
prepStmt = con.prepareStatement
("SELECT XPDLREF FROM PROCESSDEFINITION "
+ "WHERE PACKAGEID = ? AND PROCESSID = ?");
prepStmt.setString(1, packageId);
prepStmt.setString(2, processId);
rs = prepStmt.executeQuery();
if(!rs.next()) {
return;
}
long xpdlId = rs.getLong(1);
rs.close();
rs = null;
prepStmt.close();
prepStmt = null;
// remove process definition from the database
prepStmt = con.prepareStatement
("DELETE FROM PROCESSDEFINITION "
+ "WHERE PACKAGEID = ? AND PROCESSID = ?");
prepStmt.setString(1, packageId);
prepStmt.setString(2, processId);
prepStmt.executeUpdate();
removeXpdlIfOrphaned(xpdlId);
} finally {
JDBCUtil.closeAll (rs, prepStmt, con);
}
} catch (SQLException e) {
throw new EJBException(e);
} finally {
scope.leave ();
}
}