• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Entity Bean Container Responsibility

 
Santosh Ramachandrula
Ranch Hand
Posts: 252
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Reference EJB 2.0 Final Release
Page: 167
2'nd bullet


2'nd bullet (line 5,6,7) --> IF the container managed collection is returned as the result of local interface method with transaction attribute RequiresNew, and the client atempts to access the collection, the Container must throw the IllegalStateException.
I don't really understand why this should happen? Can someone exlplain this?
[ May 06, 2004: Message edited by: Santosh Ram ]
 
Praveena Venigalla
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
IF the container managed collection is returned as the result of local interface method with transaction attribute RequiresNew, and the client atempts to access the collection, the Container must throw the IllegalStateException.
---------------------------------------------------------------------------------------------
For sure...the Container must throw the IllegalStateException.
Transaction attribute RequiresNew specifies that the called method starts a new transaction and the calling methods transaction is suspended until the called method transaction is completed. So Client cannot acess the collection.
Praveena
 
Roger Chung-Wee
Ranch Hand
Posts: 1683
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My reading of this is that the problem arises because the cmr-field always runs in a transaction which is different to the calling transaction (because the transaction attribute is RequiresNew).
If I am correct, then should the calling method be in a transaction and if the cmr-field is run with the transaction attribute Required, Mandatory or Supports, then there would be no exception thrown.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic