Sonu, January 13, 2005 - 4:23 pm UTC
I think I have over simplified the example, what I wanted to know was how best to use java multi-threading to process a large(eg : 5,000,000) Oracle resultset, because java code knows the complex logic of updating the salary.
January 13, 2005 - 5:08 pm UTC
rowid ranges. suggestion: write a single program and run 10 of them. single threaded = comprehendable by humans. multi-thread = technically really cool sounding but geez, when it goes wrong -- bam.
You are going to have 10 separate connections anyhow...
see
</code>
http://asktom.oracle.com/pls/asktom/f?p=100:11:::::P11_QUESTION_ID:10498431232211 <code>
5,000,000 employees, impressive ;)
I find most logic, when exposed -- is not so complex.... i'd still look at SQL. You'd be surprised what it can do.
Java Threads in Oracle Server Side Database
olerag, December 22, 2006 - 8:27 pm UTC
I've done something similar pertaining to this topic. A Java class with 20 threads (each with its own connection) invokes a PLSQL packaged procedure to retrieve information and insert the results in CLOB rows, used for web search/display capabilities. In so doing, the overall processing time decreased by approx 30%.
Q1. Can you confirm that this manipulation, executed in a single Unix process and using 20 independent connections, is running 20 separate sessions? Enterprise Manager seems to confirm this?!?
Q2. When the Java source is transfered to the database as a stored Java class and executed, only one session for the job appears in Ent Mgr. Do you know if multi-thread Java source runs differently on an Oracle Server-Side database than from a client-side machine?
Note. For Q2 only, the "default" JDBC connection is being utilized.
December 24, 2006 - 9:00 am UTC
if you have 20 threads and each thread has it's own connection, well - yes you have 20 separate sessions.
a multi-threaded java application in the database uses a single thread, there is NO concurrency, you do not really want to do that.
Merry XMAS Tom
olerag, December 24, 2006 - 12:10 pm UTC
Can't believe it - XMAS eve (on a Sunday yet) and Tom replies; you absolutely "rock". Thanx for the reply; it is as I expected and appreciate your confirmation. Have a great holiday season!!