Issue with TWO Servoy Smart Client running simultaneously

Questions, answers, tips and ideas on Servoy Client

Issue with TWO Servoy Smart Client running simultaneously

Postby Infop » Wed Feb 10, 2010 8:48 am

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,
User avatar
Infop
 
Posts: 151
Joined: Fri Nov 30, 2007 3:00 pm

Re: Issue with TWO Servoy Smart Client running simultaneously

Postby IT2Be » Wed Feb 10, 2010 9:56 am

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?
Marcel J.G. Trapman (IT2BE)
SAN partner - Freelance Java and Servoy
Servoy Components - IT2BE Plug-ins and Beans for Servoy
ServoyForge - Open Source Components for Servoy
User avatar
IT2Be
Servoy Expert
 
Posts: 4766
Joined: Tue Oct 14, 2003 7:09 pm
Location: Germany

Re: Issue with TWO Servoy Smart Client running simultaneously

Postby Infop » Wed Feb 10, 2010 10:30 am

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,
User avatar
Infop
 
Posts: 151
Joined: Fri Nov 30, 2007 3:00 pm

Re: Issue with TWO Servoy Smart Client running simultaneously

Postby ars » Thu Feb 11, 2010 11:40 am

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?
Arup Sahoo

Servoy Developer and Consultant

Find me @ arup.sahooATgmail.com
Skype me @ arup.sahoo
GTalk me @ arup.sahoo
User avatar
ars
 
Posts: 213
Joined: Thu Jun 28, 2007 2:04 pm
Location: India

Re: Issue with TWO Servoy Smart Client running simultaneously

Postby Infop » Thu Feb 11, 2010 3:45 pm

Hi Arup,

Yes, It solved the Issue.

Thank you very much.
User avatar
Infop
 
Posts: 151
Joined: Fri Nov 30, 2007 3:00 pm


Return to Servoy Client

Who is online

Users browsing this forum: No registered users and 6 guests

cron