• 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

Stateless session bean and transaction question

 
Ranch Hand
Posts: 1209
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In Page 347 of the spec, they have given an example wherein a Session bean holds on to a transaction w/o commiting over multiple methods.
method1() does a begin()
and then method3 does a commit finally.
Now the spec also says that a business method in a stateless session bean must commit a transaction before it returns. Is'nt method1() supposed to do a commit before returning?
Does this mean that the bean they are referring to in the code is "Stateful" and NOT "Stateless"?
Or am I missing something?
thanks!
 
Ranch Hand
Posts: 8945
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It is stateful and not stateless.
 
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by karthik Guru:
In Page 347 of the spec, they have given an example wherein a Session bean holds on to a transaction w/o commiting over multiple methods.
method1() does a begin()
and then method3 does a commit finally.
Now the spec also says that a business method in a stateless session bean must commit a transaction before it returns. Is'nt method1() supposed to do a commit before returning?
Does this mean that the bean they are referring to in the code is "Stateful" and NOT "Stateless"?
Or am I missing something?
thanks!


Hallo karthik,
the code Example on the page 347 is for a SFSB. There is nowhere in the Text a statement that it is a SLSB.IMO The code on the page 374 is a variant of the code on the page 345, for that code example is explicitly stated that it is a SFSB.
Dragan

Dragan
 
Karthik Guru
Ranch Hand
Posts: 1209
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Pradeep, Dragan, thanks for confirming.
reply
    Bookmark Topic Watch Topic
  • New Topic