• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Rob Spoor
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
  • Scott Selikoff
Bartenders:
  • Piet Souris
  • Jj Roberts
  • fred rosenberger

Remove() question

 
Ranch Hand
Posts: 277
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello everyone:
On page 79 of the spec it says

An attempt to remove a
session object while the object is in a transaction will cause the container to throw the
javax.ejb.RemoveException to the client.


I was trying to come up with a scenario where a session object using CMP could be in a trasaction when remove was called but could not. My understanding is that all business methods that run in a transaction context will complete their transaction before returning and therefore when remove is called the object will no longer be in a transcation. Since this statement is in the spec, I assume that it is possible for the object to be in a transaction when remove is called. Can anyone please describe a scenario where this is the case.
Thanks,
 
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hei Keith,
As far as i understand, Let's say client A is invoking a getAdviceFrom()method in AdviceBean with transaction, if client B tries to remove the AdviceBean, then container throws RemoveException. The invoked method must return before the AdviceBean can be removed.
Anybody has any explanation,please?
 
Keith Rosenfield
Ranch Hand
Posts: 277
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Tulsi:
I don't understand. How does client B even get a hold of the bean since it should be exclusive to one client? Even if does, I thought that the container would serialize calls to the bean, therefore it will not call remove() until getAdviceFrom() is complete. I am not sure what the source of my confusion is. Am I making an assumtion that is incorrect?
Please help me clear up my confusion.
Thanks,
 
Bartender
Posts: 1872
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Keith,
I guess it only applies to stateful session beans with BMT, where a transaction may span multiple methods.
All best,
Phil.
 
Keith Rosenfield
Ranch Hand
Posts: 277
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Phillipe:
That makes sense.
Thanks,
 
reply
    Bookmark Topic Watch Topic
  • New Topic