From: Phil D. <ph...@lo...> - 2008-03-06 09:04:35
|
Yes now I'm in my 20s I'm finding I need to keep notes to remember stuff :-) I thought your first plan was good ... we simply change to using the GetNextTransNo function in sales orders - this locks the systypes table first then gets the next trans number of the type passed in .. a shimmy and a side step and we get away cleanly with no scope for duplicates or mix ups with insertid. Phil Tim Schofield wrote: > You are right Phil, at my age I shouldn't rely on my memory, and > should check these things out :-) > > The problem is that the method I used and the took out for sales > orders, is still liable to suffer from a race condition, if two people > are inputting sales orders simultaneously. > > I need to dig deeper. These are very rare, but can still happen. Maybe > table locking is called for? > > Tim > > > On 06/03/2008, Phil Daintree <ph...@lo...> wrote: > >> I think you put the GetNextTransNo in the code for sales orders - but >> maybe took it out again ... using this function for sales orders would >> eliminate this snag... I think Andres issue could still be at large >> because we are using the LastInsert id function to get a sales order >> number and since this is not dependent on the table it is possible to >> get the wrong id back.. >> >> Phil >> >> Tim Schofield wrote: >> >>> Andres, >>> >>> I did some fairly major changes to this function after 3.08 came out, >>> you might like to try the cvs version I put out. There was a very tiny >>> chance of this happening - I think you are the first to report it - >>> but hopefully it shouldn't happen now. Let me know, >>> >>> Tim >>> >>> >>> On 05/03/2008, andres amaya diaz <bow...@gm...> wrote: >>> >>> >>>> Hello everybody, i'm a little concerned about something i found today in >>>> weberp 3.08 (i dont know if it apply to other versions), the thing is that i >>>> was playing around at the same time doing a purchase order and a sales >>>> order, modifying them, adding new items, deleting others and somehow the >>>> data between orders got mixed up, so when i created the sales order it was >>>> suppossed to be sales order #5 and it appear sales orer #2 (that is the >>>> purchase order i was playing with) :-S >>>> >>>> Ive been searching on the code for some session variables that could cause >>>> the problem with no luck, and then i realize that maybe is the >>>> DB_Last_Insert_ID function that calls the mysql_insert_id and retrieves the >>>> last insert id and this function might be getting #2 from the purchase order >>>> and not the sales order #5. >>>> >>>> I hope you can understand what the problem is, and try it please so we can >>>> solve the problem. >>>> >>>> Thanks... andres amaya diaz >>>> >>>> >>>> |