We have a very weird issue in our Siebel 7.8 application.
In the Application_Start
event we define a bunch of profile attributes, which determine if the logged user will be allowed to perform certain operations or not. The code is something like this:
if (userHasSuperpowers) {
TheApplication().SetProfileAttr("CanFly", "Y");
} else {
// CanFly is not set, and GetProfileAttr("CanFly") returns ''
}
Everything works fine, except for one of these profile attributes. The conditions are not met, so we don't set its value. But when we check it using GetProfileAttr
... it returns 'Y'
instead of ''
.
I've checked the code. A lot. I've put traces everywhere, and I'm 100% sure that when the last line of the Application_Start
event executes, the attribute is still empty. However, in the first Applet_Load
event after the login (in the HLS Salutation Applet (HLS Home)
applet), its value has already changed to 'Y'
. Why!!? I've looked everywhere, but I can't find anywhere else where we'd be doing a SetProfileAttr
. So far, I've ruled out:
Personalization Profile
business component fields.SIS OM PMT Service
method Set Profile Attribute
.But wait, there is more, I left the best part for last: the problem only happens in our development environment!
'Y'
.Where else could I search the profile attribute being set? I've read that they can be persisted to the DB, but in order to do so, you have to define them as a field in a BC based on an S_PARTY extension table, right?
Is there any way to trace profile attribute changes somehow? Maybe rising some loglevel?
How can I find out at least what's being executed after the Application_Start
, before loading the first applet?
Any other ideas? I tried checking the SQL spool file too, but didn't find anything suspicious there either (i.e., any of the queries we use to check the conditions, being run twice with different parameters).
Update: following Ranjith R's suggestions, I've also checked:
User Registration > SetProfileAttr
, SessionAccessService > SetProfileAttr
and ISS Promotion Agreement Manager > SetProfileAttributes
.Still no luck...
Ok... finally we found what's happening:
Application_Start
event, for the SADMIN
user.SADMIN
is the Siebel administrator user, so yes, he hasSuperpowers
and therefore we do TheApplication().SetProfileAttr("CanFly", "Y");
.Application_Start
event finishes.Application_Start
event, this time for our user. This is the one I was monitoring with the trace files.hasSuperpowers
, so we don't set any value for the CanFly
attribute.Application_Start
event finishes, and CanFly
is still empty.SADMIN
.I'm sure it happens that way, for two reasons. First, we changed the profile attribute name to include the username too. And second, instead of storing just an "Y"
, we are storing now the current date:
var time = (new Date()).getTime();
TheApplication().SetProfileAttr("CanFly_" + TheApplication().LoginName(), time);
We end up having CanFly_SADMIN
, but no CanFly_USER
, and the time value stored is the same we see in the log file for step 2... which is smaller than any of the values for the *_USER
attributes.
So that's what happening. I still don't know why Siebel behaves this way, but that would be matter for another question. According to the Siebel bookshelf:
The Start event is called when the client starts and again when the user interface is first displayed.
...but it doesn't say anythign about it being called from two different sessions, different users too, and then merging them together. It must be something misconfigured in our dev environment, considering it doesn't happen in the other ones.