Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » DBISAM Technical Support » Support Forums » DBISAM General » View Thread |
Messages 1 to 4 of 4 total |
OT: Thread running twice |
Thu, Oct 22 2009 1:41 PM | Permanent Link |
"Eduardo [HPro]" | Hi guys
I have a routine in a multithread DLL. Sometimes I have some trouble with the code running twice for some users. Example: procedure X; begin if Table.FindKey([key]) then begin Table.Edit; Table.FieldByName('X').AsInteger := Table.FieldByName('X').AsInteger + 1; Table.Post; end; end; If the initial value is 1 the correct value after the routine should be 2. I have a log to this operation with something like below: OldValue NewValue 1 2 2 3 3 4 Sometimes I only run the procedure once and it will produce two rows in the log table (like two threads runing for the same clients). I wonder if someone could drives me to prevent this type of thing. It could be a problem with threads ? Eduardo |
Thu, Oct 22 2009 1:47 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | Eduardo,
<< I wonder if someone could drives me to prevent this type of thing. It could be a problem with threads ? >> The only way that I can think of this occurring is if you have threads stepping on each other's objects because they are not properly isolated via critical sections or separate objects. BTW, have you ever sent me the source code to this project ? This could be related to your issue with index corruption. -- Tim Young Elevate Software www.elevatesoft.com |
Thu, Oct 22 2009 3:04 PM | Permanent Link |
"Eduardo [HPro]" | Tim
> BTW, have you ever sent me the source code to this project ? This could > be related to your issue with index corruption. It was sent to your private e-mail Eduardo |
Thu, Oct 22 2009 7:28 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | Eduardo,
<< It was sent to your private e-mail >> Okay, I'll take a look. Thanks, -- Tim Young Elevate Software www.elevatesoft.com |
This web page was last updated on Thursday, April 18, 2024 at 10:42 AM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |