Hi All,
Hope you are well, once again its been a while xsince my last visit. Still busy doing house things.
Came across an issue a week or so back at work regarding the use of shared functions. Basically the code I was looking at had a customer structure that was declared as shared. The bottom line of this was every time our web site was busy on this page quite often a customer would update their details but in fact as these structures would quite often have the wrong Sales ID so in fact they updated somebody elses instead.
Took a while to find the problem as this never anywhere else apart from the live system as it needed more than one person to cause this problem. Anyway I put some database logging code in and discovered what the problem was.
Since the code has gone out this error has stopped.
Now I am looking at another problem that I suspect could be caused by the same thing. There is a function in our site that calculates VAT. In our error logs with sometimes get quite a few errors to this effect: Count cannot be less than zero Parameter name count. When I was looking through this class I noticed there was aroung 10 functions. None are shared except the function that errors.
I was wondering if there is known issues with shared functions in web development and it is considered generally bad practice to use them?
Thank, Dave.
Hope you are well, once again its been a while xsince my last visit. Still busy doing house things.
Came across an issue a week or so back at work regarding the use of shared functions. Basically the code I was looking at had a customer structure that was declared as shared. The bottom line of this was every time our web site was busy on this page quite often a customer would update their details but in fact as these structures would quite often have the wrong Sales ID so in fact they updated somebody elses instead.
Took a while to find the problem as this never anywhere else apart from the live system as it needed more than one person to cause this problem. Anyway I put some database logging code in and discovered what the problem was.
Since the code has gone out this error has stopped.
Now I am looking at another problem that I suspect could be caused by the same thing. There is a function in our site that calculates VAT. In our error logs with sometimes get quite a few errors to this effect: Count cannot be less than zero Parameter name count. When I was looking through this class I noticed there was aroung 10 functions. None are shared except the function that errors.
I was wondering if there is known issues with shared functions in web development and it is considered generally bad practice to use them?
Thank, Dave.