Win a copy of Fixing your Scrum this week in the Agile forum!
  • 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:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Rob Spoor
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Junilu Lacar
  • Tim Cooke
Saloon Keepers:
  • Tim Holloway
  • Piet Souris
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Frits Walraven
  • Himai Minh

Getting javax.ejb.RemoveException in stateful exception

 
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm working on a maintenance project . In this project, There is a stateful bean with the name "RegistrarManagerBean" and the component interface name is "LocalRegistrarManager".

There are some business logic after executing the business logic the following finally block has been called .




After executing this line " localRegistrarManager.remove()", it throws the following error

javax.ejb.RemoveException: Cannot remove EJB: transaction in progress.


Actually there is no business logic after this line .Could you please some one let me know how to fix this issue .
 
Ranch Hand
Posts: 623
1
IntelliJ IDE Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I guess there should be a business logic BEFORE this line and not after? Are you sure your SFSB doesn't use bean managed transaction demarcation and there isn't any active transaction which spans on several business methods?

Cheers!
 
SampathKumar chinnadurai
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Pedro,

yes , There are some business logic before the finally block. yes , we are using the bean managed transaction demarcation. These methods have been completed before calling the finally block .

Is it possible to call the below code to find the transaction and forcefully rollback it . Is there any other way we can avoid the exception(RemoveException)?


I got this code from following url StatefulSessionContainer


Please provide your thoughts .



 
Piotr Nowicki
Ranch Hand
Posts: 623
1
IntelliJ IDE Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
And before the 'finally' block in @Remove method (or from one of your business methods) you did committed the transaction using UserTransaction#commit()?
 
SampathKumar chinnadurai
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The EJB version is 2.0. we have not used the @ Remove . but before the finally block all the transactions have been committed . i understand that somewhere its missing , we did not commit the transaction.

This is a large project , so i'm not able to locate the exact transaction .

Is there any way i can stop the exception. This exception creates big problem in the production .
 
Piotr Nowicki
Ranch Hand
Posts: 623
1
IntelliJ IDE Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sorry, I'm not familiar with EJB 2.0...

So you did not try to commit the transaction - can you just get the current transaction from within the method (I guess you can get it from the SessionContext?), commit it (or rollback it) and see the results?

Sorry I can't be of any help - maybe someone with better knowledge could help you.
 
if you think brussel sprouts are yummy, you should try any other food. And this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic