Forums Register Login

Stateless session bean and transaction question

+Pie Number of slices to send: Send
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!
+Pie Number of slices to send: Send
It is stateful and not stateless.
+Pie Number of slices to send: Send
 

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
+Pie Number of slices to send: Send
Pradeep, Dragan, thanks for confirming.
Oh the stink of it! Smell my tiny ad!
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 1049 times.
Similar Threads
When CMT bean commit?
Transaction boundries in CMT
Stateful session bean with Bean Managed Transaction
Wrong answer/explanation in com.enthuware.ets.scbcd.v5.2.161
A question about MDB
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 23:47:50.