Board index » off-topic » Somebody here can help whether or not?

Somebody here can help whether or not?


2003-11-19 06:11:03 PM
off-topic11
"Alex" < XXXX@XXXXX.COM >wrote:
Quote

It's me again.
I've rewrote the code with a separate TSession and TDataBase for each thread as you recommended. But the bug is still there :(.
Help, please.

The code is here:
www25.brinkster.com/alex99933/db_test.html
 
 

Re:Somebody here can help whether or not?

"Mick Arundell" < XXXX@XXXXX.COM >wrote:
Quote
Where is the TSession.Create line?
Where is the TDatabase.Create line?
DoubleRecordTest.dpr (34): sesIns := TSession.Create(nil);
DoubleRecordTest.dpr (51): dbIns := TDatabase.Create(nil);
 

Re:Somebody here can help whether or not?

"Michael Harris" < XXXX@XXXXX.COM >wrote:
Quote
Alex

Sorry, I cannot locate the description of this issue.
Could you describe (EXACTLY) what 'bug' you are concerned with ?
newsgroups.borland.com/cgi-bin/dnewsweb?utag=&group=borland.public.bde&xrelated=35083&cmd_related=Related+Items
newsgroups.borland.com/cgi-bin/dnewsweb?utag=&group=borland.public.bde&xrelated=35324&cmd_related=Related+Items
 

{smallsort}

Re:Somebody here can help whether or not?

Where is the TSession.Create line?
Where is the TDatabase.Create line?
mick
"Alex" < XXXX@XXXXX.COM >wrote in message
Quote

"Alex" < XXXX@XXXXX.COM >wrote:
>
>It's me again.
>I've rewrote the code with a separate TSession and TDataBase for each
thread as you recommended. But the bug is still there :(.
>Help, please.
>
>The code is here:
>www25.brinkster.com/alex99933/db_test.html

 

Re:Somebody here can help whether or not?

Alex
Sorry, I cannot locate the description of this issue.
Could you describe (EXACTLY) what 'bug' you are concerned with ?
"Alex" < XXXX@XXXXX.COM >wrote in message
Quote

"Alex" < XXXX@XXXXX.COM >wrote:
>
>It's me again.
>I've rewrote the code with a separate TSession and TDataBase for each
thread as you recommended. But the bug is still there :(.
>Help, please.
>
>The code is here:
>www25.brinkster.com/alex99933/db_test.html

 

Re:Somebody here can help whether or not?

OK, thanks.
The only way I know of to reduce the possible search for a 'bug' of this
nature is to use BDE API
calls directly.
You will find the error lies in the grid in more cases than not..
However, I see you have ported the code to CBuilder so I will look more
closely.
"Alex" < XXXX@XXXXX.COM >wrote in message
Quote

"Michael Harris" < XXXX@XXXXX.COM >wrote:
>Alex
>
>Sorry, I cannot locate the description of this issue.
>Could you describe (EXACTLY) what 'bug' you are concerned with ?

newsgroups.borland.com/cgi-bin/dnewsweb?utag=&group=borland.public.bde&xrelated=35083&cmd_related=Related+Items


newsgroups.borland.com/cgi-bin/dnewsweb?utag=&group=borland.public.bde&xrelated=35324&cmd_related=Related+Items
 

Re:Somebody here can help whether or not?

Are you creating a Session and a Database for every thread?
Mick
"Alex" < XXXX@XXXXX.COM >wrote in message
Quote

"Mick Arundell" < XXXX@XXXXX.COM >wrote:
>Where is the TSession.Create line?
>Where is the TDatabase.Create line?

DoubleRecordTest.dpr (34): sesIns := TSession.Create(nil);
DoubleRecordTest.dpr (51): dbIns := TDatabase.Create(nil);


 

Re:Somebody here can help whether or not?

"Michael Harris" < XXXX@XXXXX.COM >wrote:
Quote
OK, thanks.

The only way I know of to reduce the possible search for a 'bug' of this
nature is to use BDE API
calls directly.
I've already tried to do so. But it also doesn't help.
 

Re:Somebody here can help whether or not?

"Mick Arundell" < XXXX@XXXXX.COM >wrote:
Quote
Are you creating a Session and a Database for every thread?
Yes. I've shown to you where I create Session and Database for one thread. For second thread the corresponding components lay on the FormGrid form.
Quote
>
>"Mick Arundell" < XXXX@XXXXX.COM >wrote:
>>Where is the TSession.Create line?
>>Where is the TDatabase.Create line?
>
>DoubleRecordTest.dpr (34): sesIns := TSession.Create(nil);
>DoubleRecordTest.dpr (51): dbIns := TDatabase.Create(nil);
>
>


 

Re:Somebody here can help whether or not?

Alex
hmm, it never fails here if I change the following code...
give it a try.
void __fastcall CSFIOThread::Execute()
{
if (FThreadEnv == NULL)
{
return;
}
if (!bSimpleFilling)
{
while (!Terminated)
{
//AddRecordInSession(); << NOTE commented out ...
Sleep(random(5000));
}
}
else
{
for (int i = 1; i <= lRecordCount; i++)
{
try
{
AddRecordInSession();
Sleep(0);
}
catch(...)
{
return;
}
g_RecCount = i;
}
}
}
 

Re:Somebody here can help whether or not?

"Michael Harris" < XXXX@XXXXX.COM >wrote:
Quote
Alex

hmm, it never fails here if I change the following code...

give it a try.
Of course "never fails". Because of by this commenting you turn off writing thread. But I need that both the threads (reading and writing) work simultaneously.
 

Re:Somebody here can help whether or not?

It seems like if you append while a select statement is executing, the
results you are getting would be expected.
Maybe the 'bug' n't in the db engine. A little different design would help.
"Alex" < XXXX@XXXXX.COM >wrote in message
Quote

"Michael Harris" < XXXX@XXXXX.COM >wrote:
>Alex
>
>hmm, it never fails here if I change the following code...
>
>give it a try.


Of course "never fails". Because of by this commenting you turn off writing
thread. But I need that both the threads (reading and writing) work
simultaneously.
 

Re:Somebody here can help whether or not?

"Michael Harris" < XXXX@XXXXX.COM >wrote:
Quote

It seems like if you append while a select statement is executing, the
results you are getting would be expected.
Maybe the 'bug' n't in the db engine. A little different design would help.
Can you show me such a design?
It is necessary, that 2 threads worked in parallel (simultaneously).
Thus onethread should add records and the second thread should at the same time execute 'select'
 

Re:Somebody here can help whether or not?

I my have some time this weekend..
 

Re:Somebody here can help whether or not?

Alex
I was able to reproduce the 'said' condition under these circumstances.
Split the Fetch (select from) , FillTable( insert into ) and AddToTable
(insert into) three threads.
where 'AddToTable' starts only after 'FillTable' ends.
The Fetch thread never failed unless the 'AddToTable' delay time dropped
below 20 ms.Sleep(random(50));
then 'ghost record appeared. actually, the correct number of records.
However, some data is duplicated.
The problem should be resolved with a more aggressive isolation level. I
almost have it worked out but unfortunately cannot continue for a day or
two.
this will either fix it or not.
DbiBeginTran (phDb, xilREADCOMMITTED, hXact);
while ( thread does whatever)