Ingo Wolfmayr created OFBIZ-12773: ------------------------------------- Summary: Async Service with multiple tenants - tenant null Key: OFBIZ-12773 URL: https://issues.apache.org/jira/browse/OFBIZ-12773 Project: OFBiz Issue Type: Improvement Affects Versions: Upcoming Branch Reporter: Ingo Wolfmayr Attachments: testsettings.patch
{*}System{*}: clean ofbiz trunk, Java 17 {*}Tenants{*}: demo, zdemo - both with demo data DB: derby (issue not db related - same issue with mysq) {code:java} ./gradlew createTenant -PtenantId=zdemo ./gradlew createTenant -PtenantId=demo ./gradlew loadTenant -PtenantId=demo -PtenantReaders=seed,seed-initial,demo ./gradlew loadTenant -PtenantId=zdemo -PtenantReaders=seed,seed-initial,demo ./gradlew ofbiz{code} Attached is a "patch" with the service for testing and the tenant settings in entityengine.xml. I use two different browsers to login to both tenants. *Tenant demo:* Then goto "webtools" --> "service engine" -->"run service": enter testx --> submit Result: ofbiz will run the first 100 jobs (100 jobs defined in serviceengine.xml). After some seconds will run the final 100 jobs. All jobs will print the tenantId. {code:java} DISPATCHER:13 - org.apache.ofbiz.service.GenericDispatcherFactory$GenericDispatcher@38b821e9 TENANT:13 - demo DISPATCHER:195 - org.apache.ofbiz.service.GenericDispatcherFactory$GenericDispatcher@38b821e9 TENANT:195 - demo{code} *Tenant xdemo:* Then goto "webtools" --> "service engine" -->"run service": enter testx --> submit Result: ofbiz will run through all 200 jobs (100 jobs defined in serviceengine.xml). Only 100 jobs will print the tenantId. {code:java} DISPATCHER:13 - org.apache.ofbiz.service.GenericDispatcherFactory$GenericDispatcher@495392e0 TENANT:13 - null DISPATCHER:195 - org.apache.ofbiz.service.GenericDispatcherFactory$GenericDispatcher@44fe81d9 TENANT:195 - zdemo{code} It seems the the last tenant (zdemo) has a problem. *The problem with this:* everything run in this jobs that require tenant specific logic will fail. I would appreciate every thought on this as I am a little bit clueless right now (after hours and hours of debugging why my jobs fail ;)). -- This message was sent by Atlassian Jira (v8.20.10#820010)