0

hi all
i want to create a program that each thread will be handle a part of the log file and read from it at the same time ??

Thanks in advance

2
Contributors
4
Replies
11
Views
4 Years
Discussion Span
Last Post by lena1990
0

Well, OK, you can do that. If this is a follow-on to you still unsolved "handling large files" topic then messing about with how you read the logs isn't going to make any real difference - it's the SQL that needs to be optimised. You may get the best throughput by having one thread reading the log and placing entries on a blocking queue, with one or more threads taking enries from the queue to update the database.
Maybe you can clarify exactly what you are trying to do, and exactly what help you need?

0

thanks for replay
i inserted one million row every 20 minutes so i think there is no problem with data base but if more than one process reads from the log and inserted to the database it will make it faster donot you think???

0

I'm goint to stick with what I suggested in my previous post. Have a single thread reading the log, and experiment to find the optimum number of threads updating the database. Have a look at the Oracle tutorial on Java Threads, and the API doc for LinkedBlockingQueue

0

i just want to see or try if it will make any difference in the number of records inserted iam still searching for the best solution

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.