on 09-06-2004 3:31 PM
Hi,
When a user closes the browser or a session expires I need to call an unlock-method for some objects. This method should prevent that the lock for this object is always there.
Can you tell me how or is there another approach for this problem?
thanks
Mathias
Hi Mathias,
the browser sends an event on close (and unload) for which an event handler is registered in the WD runtime. This handler exits the corresponding component controller, which leads to a call of the wdDoExit() methods of the component and all dependant controllers. So it should be sufficient to put the "unlock" functionality you need into the wdDoExit methods of the controller(s) which locked the objects.
Hope that helps.
Regards
Stefan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Stefan
I did a trace on the wdDoExit method and indeed it is called when the object is unloaded . But try doing a multiple refresh on the page and it is interesting to see that in some cases the wdDoInit of the next object is called before the wdDoExit method of the previous object is called and in some cases wdDoExit is never called and you would have to wait for Web Dynpro time out for these objects to actually be unloaded and release any connections they are holding.
Mathias : We too implemented locking via RFC but we saw that the user locks himself out if he does multiple refreshes(fast) on the same page , specifically because the wdDoExit is not being called and the lock not being released
Regards
Pran
Yep,
import com.sap.tc.webdynpro.services.session.IMaintainScope;
import com.sap.tc.webdynpro.services.session.IScopeListener;
import com.sap.tc.webdynpro.services.session.Utils;
import com.sap.tc.webdynpro.services.session.api.WDScopeType;
...
private void sessionSample()
{
final IMaintainScope sessionManager = Utils.getScopeMaintainer( WDScopeType.CLIENTSESSION_SCOPE );
sessionManager.registerToBeDestroyedListener
(
new IScopeListener()
{
public void scopeToBeDestroyed(IMaintainScope maintainScope)
{
/* Your cleanup logic here */
maintainScope.unregisterToBeDestroyedListener( this );
}
}
);
}
WBR,
VS
Hi,
Thanks God my mom doesn't stay behind me when I'm typing this...
Conventional wisdom says that if somethig forbidden is very desirable, then it is allowed
Seriously, there is no way to do a LOT of things in WD without resorting to such API calls. I agree that these calls should be avoided at all cost, but...
1. How to use Servlet-like session without IScope?
2. How to intercept request/response cycle without IPhaseListener?
3. How to use ThreadLocal safely in WD (where java threads are allocated from pool and swaped between users) without ITask?
4. How to embedd arbitary component interface view dynamically without calls to addRelatedModelObject / setRelatedModelObject with hard-coded internal relation names?
5. How to replicate runtime repository content to external storage and further restore it on different server without refering classes in *.repository package?
6. How to... you may continue the list
Well, I need such functionality now and cannot wait till SP_XXX to be released in several monthes from now.
Regards,
VS
Hi Armin,
thanks for participating...
Do you have a solution for my problem?
Best Regards
Mathias
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.