GeeCON Prague 2014*
The moose likes EJB and other Java EE Technologies and the fly likes RemoveException(): Illegal attempt to remove a stateful session bean... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "RemoveException(): Illegal attempt to remove a stateful session bean..." Watch "RemoveException(): Illegal attempt to remove a stateful session bean..." New topic
Author

RemoveException(): Illegal attempt to remove a stateful session bean...

will boyd
Greenhorn

Joined: May 16, 2001
Posts: 11
hi,

i'm new to ejbs; new to weblogic server/workshop. going through the e-docs tutorials and playing around with things. i got a custom java control that wraps (delegates to) an ejb control that in turn wraps a stateful session bean. i structured it this way as a workaround to the issue described in this dev2dev article:

Control Lifetime Considerations when Invoking Controls from Page Flows

i need the ejb's operations to be transactional. i'm using container-managed transactions. i got a page flow that calls the custom java control within the page flow's default transaction context:



the pageFlowAction() method returns successfully. there are no other actions taking place in the page flow after pageFlowAction() successfully returns. however, i get a
javax.ejb.RemoveException(): Illegal attempt to remove a stateful session bean while it is participating in a transaction
error (see full stack trace below). here are my questions:

  • what can i do to achieve a _legal_ removal of the stateful session bean instance?
  • would an empty ejbRemove() on the sfsb have any effect?
  • is SessionSynchronization appropriate here?
  • would bean-managed transactions using javax.transaction.UserTransaction make a difference?
  • is the sfsb's remove() method being called by a default onRelease() life cycle method of either the ejb control or the custom java control?


  • what i have already done to get rid of the RemoveException is to use an slsb instead. but i think an sfsb is more appropriate for the particular use case i am addressing.

    thanks for your help.

     
    GeeCON Prague 2014
     
    subject: RemoveException(): Illegal attempt to remove a stateful session bean...