File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes Stateless session bean and transaction question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "Stateless session bean and transaction question" Watch "Stateless session bean and transaction question" New topic
Author

Stateless session bean and transaction question

Karthik Guru
Ranch Hand

Joined: Mar 06, 2001
Posts: 1209
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!
Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8919

It is stateful and not stateless.


Groovy
Dragan Milic
Ranch Hand

Joined: Oct 03, 2002
Posts: 31
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

Joined: Mar 06, 2001
Posts: 1209
Pradeep, Dragan, thanks for confirming.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Stateless session bean and transaction question