The ArticleEJB is a CMP entitybean,so the remove() method is empty.
and ArticleManagerEJB is a sessionbean, he call the ArticleEJB's remove to delete a
article from database,the source code is :
public void deleteArticle(long id){
Article article;
try{
article = articleHome.findByPrimaryKey(new Long(id));
article.remove();
article=null;
}
catch(Exception ex){
throw new EJBException(ex);
}
}
application run here is right,no exception report.
but when i list article again, the NoSuchObjectException was throwed.
the list method source is :
public String list(int col){
try{
Collection collectionArticle = articleHome.findByColumn(col);
Object[] articles = collectionArticle.toArray();
StringBuffer res = new StringBuffer();
res.append("<article_list>");
for(int i=0;i<articles.length;i++){
res.append("<article>");
ArticleInfo info = ((Article)articles[i]).getArticle();
res.append("<id>"+info.id+"</id>");
res.append("<column>"+info.colum+"</column>");
res.append("<title>"+info.title+"</title>");
res.append("<author>"+info.author+"</author>");
res.append("<email>"+info.email+"</email>");
res.append("<date>"+info.cdate+"</date>");
res.append("<editor>"+info.editor+"</editor>");
res.append("</article>");
}
res.append("</article_list>");
return res.toString();
}
catch(Exception ex){
throw new EJBException(ex);
}
}
thank you very much.
===========================================================================
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".