Page 1 of 1

Issue with TWO Servoy Smart Client running simultaneously

PostPosted: Wed Feb 10, 2010 8:48 am
by Infop
Hi All,

I am facing a strange issue in one of my project.

With the Servoy solution running in two different Smart Clients, and one user hits the "New Product" button to create a new Product and begin entering the details of the product, at the same time, the other user hits the "New Product" button to create a new product. But, when the 2nd. user hits the new product button(while the 1st. user in the middle of entering the product details), the 1st. users Product details screen loaded with a different product details.

Does anyone have any idea about the possible cause of the issue??

Thanks,

Re: Issue with TWO Servoy Smart Client running simultaneously

PostPosted: Wed Feb 10, 2010 9:56 am
by IT2Be
Does anyone have any idea about the possible cause of the issue??
I think your car engine needs more oil ;)

Can you share (parts of) your code to see what you are trying to do?

Re: Issue with TWO Servoy Smart Client running simultaneously

PostPosted: Wed Feb 10, 2010 10:30 am
by Infop
Here, is the code for the Creating new Product.

Code: Select all
        //   create and show
   if(g_current_tenant_to_products.newRecord(true,true) && databaseManager.saveData()){
      globals.products_link(g_current_tenant_to_products.product_id);
   }


here is the source code for products_link() method

Code: Select all
        var id = arguments[0];
   if(!id){
      id = forms[application.getMethodTriggerFormName()].product_id;
   }
   
   if(!g_current_tenant_to_products.selectRecord(id))
      {
         var suc = (g_current_tenant_to_products.find())
         if(suc){
            g_current_tenant_to_products.product_id = id;
            g_current_tenant_to_products.search();
         }
         else
            g_current_tenant_to_products.loadAllRecords();
      }


I am just creating the new product for the current tenant and showing that product in the product detail screen. The globals.products_link() will take the product_id as an argument and display the product.

Thanks,

Re: Issue with TWO Servoy Smart Client running simultaneously

PostPosted: Thu Feb 11, 2010 11:40 am
by ars
Hi,

This seems the cause with the same relation, you are using the new record and filtering the foundset. You are using the relation, "g_current_tenant_to_products" to create a new product and again use the same relation in the globals.products_link() method to filter the the foundset according to the product_id field.

So, Can you check by creating a different relation with the same criteria that you have used for "g_current_tenant_to_products" and use that newly created relation while creating the new product. I think, it will fix the issue.

I have also faced these type of issues and following the above mentioned way, fixes those. I think, Servoy should handle the relations differently for different clients. But, here, i think, it is sticking with a single relation instance for all the clients. Can anyone, please, put some lights on it?

Re: Issue with TWO Servoy Smart Client running simultaneously

PostPosted: Thu Feb 11, 2010 3:45 pm
by Infop
Hi Arup,

Yes, It solved the Issue.

Thank you very much.