keep the discussion ont he list so all can benefit (o:

On Tue, 4 Dec 2001, sharetop wrote:
> 
> Yes, deleteArticle() in the ManagerEJB( a stateful sessionbean) and
> list() in the ShowerEJB(a stateless sessionbean).
> 
> I use the j2sdkee1.3,and database is mysql.what matter with them?

I dont know - possibly nothing.

are both methods called int he same tx context, or do you call one then
the other?  I really have no idea why its not working... and am just
trying to think of things that might lead you to more information...

cheers
dim

> 
> 
> 
> >hmmm... that is odd... not sure I'm going to be able to offer any more
> >immediately... from what I understand of what you're describing it all
> >should be ok...
> >
> >both methods are in the session bean right?  what app server are you
> >running on?
> >
> >cheers
> >dim
> >
> >On Mon, 3 Dec 2001, sharetop YC wrote:
> >
> >> 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.
> >>
> 
>                     ��
> ��
> 
>             sharetop
>             [EMAIL PROTECTED]
> 
> 

==========================================================================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