wood burning stoves 2.0*
The moose likes JDBC and the fly likes multiple thread polling the table Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "multiple thread polling the table" Watch "multiple thread polling the table" New topic
Author

multiple thread polling the table

Cibin Ka
Greenhorn

Joined: Aug 02, 2008
Posts: 1
Hi all,

I have 12 threads polling one database table. When the program is actively running, the response is very slow in Query Analyzer for a select statement querying the same table. Anybody know what is the cause of that ? and any ways to prevent this ?
Am I updating the database table too frequently and eat up all the resources 'coz the threads are updating the status column of the result set.

Thanks in advance.
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 30789
    
157

Cibin,
Welcome to JavaRanch!

Some questions to help pinpoint the error?
1) How long does this select take if you do a single query while no updates are running? If it isn't very short, maybe the query can be tuned.
2) How long does a single update take if nothing else is happening? If it isn't very short, the updates could be grabbing write locks for a long time.
3) Are all the threads/updaters within the same JVM? Or are some of them? If so, you may not need a database hit each time.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: multiple thread polling the table