[ofbiz-branch-10.4] Error in logout for multitenant application

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

[ofbiz-branch-10.4] Error in logout for multitenant application

Ganesh B
Hi All,

I am working on multi-tenant e-commerce stores. When I log out from the
e-commerce application I get random errors and it seems tenant delegator is
not used by the request.

Further digging into the code, I found that in doBasicLogout() method of
LoginWorker class, default delegator is used instead of tenant delegator and
due to this tenant related data such as store, theme is not found and errors
are thrown.

Code snippet from LoginWorkder.java (line number 616 )

        if (delegatorName != null) {
            // if there is a tenantId in the delegatorName remove it now so
that tenant selection doesn't last beyond logout
            if (delegatorName.indexOf('#') > 0) {
                delegatorName = delegatorName.substring(0,
delegatorName.indexOf('#'));
            }
            session.setAttribute("delegatorName", delegatorName);

            delegator = DelegatorFactory.getDelegator(delegatorName);
            LocalDispatcher dispatcher =
ContextFilter.makeWebappDispatcher(session.getServletContext(), delegator);
            setWebContextObjects(request, response, delegator, dispatcher);
        }

What is the best way to use logout function is multi-tenant e-commerce
applications?



--
Thanks & Regards
Ganesh Bawne
Enterprise Software Developer
Viithiisys Pvt. Ltd.
http://www.viithiisys.com
Reply | Threaded
Open this post in threaded view
|

Re: [ofbiz-branch-10.4] Error in logout for multitenant application

David-DiSiD Technologies
Hi Ganesh,

It's a known bug:
https://issues.apache.org/jira/browse/OFBIZ-3736, there is a patch attached proposed to solve this problem.

I tested the patch and seems that doesn't fix the bug, but I did't test it further (not enough time)

You can vote this Jira issue in order to dev team take it in account (more)... or you can try to solve it and attach a patch, it would be great.

Cheers,
David
DiSiD Technologies, S.L. - http://www.disid.com
Reply | Threaded
Open this post in threaded view
|

Re: [ofbiz-branch-10.4] Error in logout for multitenant application

Ganesh B
Thank you David,

But the bug you described is different than the problem I am facing.
I am getting error when I log out from the multi-tenant e-commerce store
 application.


Thanks,
Ganesh


On Wed, Jul 28, 2010 at 3:27 PM, David-DiSiD Technologies <
[hidden email]> wrote:

>
> Hi Ganesh,
>
> It's a known bug:
> https://issues.apache.org/jira/browse/OFBIZ-3736, there is a patch
> attached
> proposed to solve this problem.
>
> I tested the patch and seems that doesn't fix the bug, but I did't test it
> further (not enough time)
>
> You can vote this Jira issue in order to dev team take it in account
> (more)... or you can try to solve it and attach a patch, it would be great.
>
> Cheers,
>
> -----
> David - dcervera at disid dot com
> DiSiD Technologies, S.L. - http://www.disid.com
> Crea Tu Tienda Virtual - http://www.creatutiendavirtual.com
> --
> View this message in context:
> http://ofbiz.135035.n4.nabble.com/ofbiz-branch-10-4-Error-in-logout-for-multitenant-application-tp2304698p2304709.html
> Sent from the OFBiz - User mailing list archive at Nabble.com.
>



--
Thanks & Regards
Ganesh Bawne
Enterprise Software Developer
Viithiisys Pvt. Ltd.
http://www.viithiisys.com
Reply | Threaded
Open this post in threaded view
|

Re: [ofbiz-branch-10.4] Error in logout for multitenant application

David-DiSiD Technologies
Oops, it's true, sorry.
But it's related. The main problem is that delegator info isn't kept right.

Are you using one store for each tenant?
If this is the case, check https://cwiki.apache.org/confluence/display/OFBIZ/Multitenancy+support#Multitenancysupport-Settingtheecommerceapp.touseanspecificTenantDatabase
You have to set your store in order to it use an specific tenant database.

Or are you using the same application web "ecommerce" for the multi-tenant users?
Then I think you have to modify doBasicLogout() in order to keep the delegator of the user that does the logout (that is, the same bug I commented, that doesn't keep the delegator when user change the app. in backend)

Cheers,
David
DiSiD Technologies, S.L. - http://www.disid.com