The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes stateful session bean 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 "stateful session bean" Watch "stateful session bean" New topic

stateful session bean

veena madhukar
Ranch Hand

Joined: Apr 28, 2006
Posts: 86
I am in the middle of some function in a stateful session bean. I need to check if the "user is logged in", "user login account is created", if not then i need to force them to happen and then continue executing remaining part of my function.

Let us say function A() in stateful session bean
perform step 1;
check if user account not created in
force user account creation
end if

check if user not logged in
force user login
end if
perform step 2
perform step 3

1> Does it make sense to have this kind of controlling logic in a stateful session bean? Any thoughts?
2> If i am using declarative authentication mechanism, then how do i control the login ui, user act creation ui to be displayed from stateful session bean.

Any thoughts or any useful relevant url pointers woule be very helpful.
Ramakrishnan Ponmudi
Ranch Hand

Joined: Apr 20, 2004
Posts: 72
it is possible to check the user is logged in or not, but it depends on bean type, bussiness method or callback methods, lifecycle state of the bean.
veena madhukar
Ranch Hand

Joined: Apr 28, 2006
Posts: 86
i am not understanding what you mean by bean type. Which bean are you referring to?

Any thoughts on having the above mentioned type of controlling logic in stateful session bean?
I agree. Here's the link:
subject: stateful session bean
It's not a secret anymore!