Help coderanch get a
new server
by contributing to the fundraiser
  • 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Remove method and rollback

 
Ranch Hand
Posts: 342
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Using glassfish appserver, if a remove method is called on an EJB 3 SFSB within a transaction,
the transaction is marked for rollback; no exception is thrown.

Is this behavoir specified in the spec or is it special to glassfish ?

At least this behavoir is in contrast to the specification for EJB 2.1 beans (see core spec 4.4.4, page 82):

If a session bean instance is participating in a transaction, it is an error for a client to invoke the
remove method on the session object's home or component interface object. The container must detect
such an attempt and throw the javax.ejb.RemoveException to the client. The container should not mark
the client's transaction for rollback, thus allowing the client to recover.

 
Ranch Hand
Posts: 856
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
yes, it is defined in specification.

there is annotation @Remove
 
Ralph Jaus
Ranch Hand
Posts: 342
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Amandeep

thanks for your answer. I was looking through the core spec and found the following (4.4 on page 76):

When the client calls a business method of the bean that has been designated as a
Remove method, or a remove method on the home or component interface, the container
invokes PreDestroy lifecycle callback interceptor method(s) (if any) for the bean instance
after the Remove method completes. This ends the life of the session bean instance.


But there is no hint that the transaction is marked for rollback. Do you know a reference
thereof in the spec ?
 
Amandeep Singh
Ranch Hand
Posts: 856
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Ralph Jaus wrote:Hi Amandeep

thanks for your answer. I was looking through the core spec and found the following (4.4 on page 76):

When the client calls a business method of the bean that has been designated as a
Remove method, or a remove method on the home or component interface, the container
invokes PreDestroy lifecycle callback interceptor method(s) (if any) for the bean instance
after the Remove method completes. This ends the life of the session bean instance.


But there is no hint that the transaction is marked for rollback. Do you know a reference
thereof in the spec ?



no i don't know.

 
This will take every ounce of my mental strength! All for a tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/t/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic