This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes Stateful bean Q Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "Stateful bean Q" Watch "Stateful bean Q" New topic

Stateful bean Q

Kedar Dravid
Ranch Hand

Joined: May 28, 2004
Posts: 333
Why are stateful session beans allowed to end a method without ending the transaction? Why isn't this true of stateless session beans?
Balaji Anand
Ranch Hand

Joined: Nov 03, 2004
Posts: 146
stateful session beans are always tied to a specific client for which it is created for. so if the tran is left open it is beleived that the same bean will get to close/continue the tran(thought it is not the safest thing to beleive that the tran will be ended for sure)

stateless seeeion beans on the contrast are not tied to a specific client. once it completes serving a client (ie a business method completes) it can be assigned to any other client. so if it has open transactions... 1. that transaction may hang out there if that instance didnt serve any other bean or 2. the subsequent calls didnt call the method that closed the transaction.
I agree. Here's the link:
subject: Stateful bean Q
Similar Threads
Stateful session beans
concurrent access?
Stateless beans and SessionSynchronization
Timer Service registration
SF Session bean threading