File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Performance and the fly likes threada dealing db Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Performance
Reply Bookmark "threada dealing db" Watch "threada dealing db" New topic
Author

threada dealing db

mohamed hamdy
Ranch Hand

Joined: Feb 13, 2003
Posts: 72
hi'
in my graduation project ( file sharing ) i had an
idea for searching the database at the server by one connection in a database manager thread which
manage accessing of the database by the other threads .
for searching i intended to pick a result set that multiple threads deals with one ofter the other in a way that all threads extracts the same record and when they all finished the result set goes to the following record and the data base manager thread counts the accessor threads and when they're gone away it permits any incoming thread to open new result set .
what's about the performance of this idea ( that use synchronization with flags ) versus permits one thread at a time deals thae database and no other thread can access the database befor the old one finished.
,thanks in advance
Ilja Preuss
author
Sheriff

Joined: Jul 11, 2001
Posts: 14112
I don't understand what problem you try to solve - why don't you just let several threads access the database concurrently?


The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
mohamed hamdy
Ranch Hand

Joined: Feb 13, 2003
Posts: 72
hi ilja,
i posted in the JDBC forum befor regarding this matter look at my post here
 
 
subject: threada dealing db
 
Threads others viewed
URLyBird: Please Help! Non-deterministick error with database record reading
Locking mechanism concept questions
Post Database lock scenario
Does my lock/Unlock approach make sense?
HashMap, lock + unlock
MyEclipse, The Clear Choice

cast iron skillet 49er

more from paul wheaton's glorious empire of web junk: cast iron skillet diatomaceous earth rocket mass heater sepp holzer raised garden beds raising chickens lawn care CFL flea control missoula heat permaculture