multithreading, again and again! 
Author Message
 multithreading, again and again!

Hi,
I've got a class, say, CMyDatabase which is supposed to encapsulate some
functionality of database access portion of my program, one of which is
appending portions of bytes to an image data type feild of a table.
Everything works fine, under one thread. I open a connection, create a
recordset, (with dynamic cursor and a client-side property) and select a
single row to the recordset. Then I try to call a method of my class, say,
AppendStream, which in turn calls AppendChunk against the mentioned
recordset pointer. Finally I call Update and Close respectively. Everythings
great when running from one thread! But when I do the same from different
threads, for example trying to update the image data type field of row no 3,
6, 9 and 17 at the same time, only one of these rows will be updated and
therefore being valid.

It would be highly appreciated if someone could tell me whats the problem
with what I've done! Let me say that each thread is using its copy of
CMyDatabase, so there's no thread-safe problem in my class arena.

Cheers,
Mehdi

--
Got a question about modems? Take a look at http://www.*-*-*.com/
"The important thing is not to stop questioning. -- Albert Einstein"



Sun, 01 Jun 2003 01:44:04 GMT  
 multithreading, again and again!
Are you sure the database driver supports multithreading?  If so, are you
record locking?

-Joe


Quote:
> Hi,
> I've got a class, say, CMyDatabase which is supposed to encapsulate some
> functionality of database access portion of my program, one of which is
> appending portions of bytes to an image data type feild of a table.
> Everything works fine, under one thread. I open a connection, create a
> recordset, (with dynamic cursor and a client-side property) and select a
> single row to the recordset. Then I try to call a method of my class, say,
> AppendStream, which in turn calls AppendChunk against the mentioned
> recordset pointer. Finally I call Update and Close respectively.
Everythings
> great when running from one thread! But when I do the same from different
> threads, for example trying to update the image data type field of row no
3,
> 6, 9 and 17 at the same time, only one of these rows will be updated and
> therefore being valid.

> It would be highly appreciated if someone could tell me whats the problem
> with what I've done! Let me say that each thread is using its copy of
> CMyDatabase, so there's no thread-safe problem in my class arena.

> Cheers,
> Mehdi

> --
> Got a question about modems? Take a look at http://www.modemmania.com
> "The important thing is not to stop questioning. -- Albert Einstein"



Sun, 29 Jun 2003 11:12:57 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. multithreading, again and again!

2. Have to build .exe again and again!

3. conversion...again

4. Shame on me - Microsoft fooled me again...

5. Question again about IWebBrowser2

6. <iostream.h> again

7. DataGrid again

8. Modals (again)

9. q: impersonation for asp.net app (again)

10. The DataGrid Again!

11. Help - Parse Error Again

12. Toolbox Bitmap (Again)

 

 
Powered by phpBB® Forum Software