This week's giveaway is in the Spring forum.
We're giving away four copies of Microservices Testing (Live Project) and have Chris Love & Andres Sacco on-line!
See this thread for details.
Win a copy of Microservices Testing (Live Project) this week in the Spring 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
  • Tim Cooke
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

stateless session bean and web service

 
Ranch Hand
Posts: 3852
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am confused in the relationship b/w web service and stateless session bean.

A stateless session bean can be a client of web service? Or A stateless session bean can be a web service? And other client can access it like web service?

Please put some more information about both.

Thanks.
 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by ankur rathi:
I am confused in the relationship b/w web service and stateless session bean.

A stateless session bean can be a client of web service? Or A stateless session bean can be a web service? And other client can access it like web service?

Please put some more information about both.

Thanks.



Yes, yes, and yes. But when you use web services instead of IIOP to access a SLSB you lose some infrastructure services like transaction propagation.
 
ankur rathi
Ranch Hand
Posts: 3852
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by eduardo ferreira:


Yes, yes, and yes. But when you use web services instead of IIOP to access a SLSB you lose some infrastructure services like transaction propagation.



Thanks Eduardo.

Can you explain little bit more about this line: "But when you use web services instead of IIOP to access a SLSB you lose some infrastructure services like transaction propagation."

I searched but didn't understand it.

Thanks.
 
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In my opinion, SLSB can still run under a container transaction. But it cannot propagate client's transaction to the bean.
 
Ranch Hand
Posts: 1855
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ankur,

you can transform a session bean into a web service, just annotate your session bean with the @WebService annotation.
 
eduardo ferreira
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by ankur rathi:

Can you explain little bit more about this line: "But when you use web services instead of IIOP to access a SLSB you lose some infrastructure services like transaction propagation."

I searched but didn't understand it.



When using container-managed transactions, you set attributes to define the transaction type of the method. When using any of the following:
# Required
# Mandatory
# Supports
If the caller has a transaction, it will be bound to the transaction used on this method (so if the caller's transaction rolls back the client transaction will roll back also). If the caller is remote, the only way for this to work is if the protocol being used is IIOP.

So, when using an EJB to expose a web service, you should think that it's methods should have only "requires new" or "not supported" transaction behavior.
 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Nagendra Inuguri:
In my opinion, SLSB can still run under a container transaction. But it cannot propagate client's transaction to the bean.



If BMT is applied, and the client is a JEE container(including the client container, from the four types of containers), yes it can!

In CMT scenario, only SLSB(as client) can do it.

Rgrds,
JV
reply
    Bookmark Topic Watch Topic
  • New Topic