Re: odd jdbc driver synchronization issue

From: Kris Jurka <books(at)ejurka(dot)com>
To: George Lessmann <glessmann(at)hotmail(dot)com>
Cc: <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: odd jdbc driver synchronization issue
Date: 2004-01-06 23:37:31
Message-ID: Pine.LNX.4.33.0401061833100.6520-100000@leary.csoft.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

> Here's my work section, modeled after your example:
>
> public void execute(int num) throws SQLException {
> for (int i=0; i<num; i++) {
>
> parentCall.execute();
> // #1
> for (int j=0; j<9; j++) {
> childCall.execute();
> // #1
> }
> // #2
> }
> // #3
> conn.commit();
> }

In this loop are you using i or j to indicate what rows to operate on in
the stored procedure calls? If so there will be huge contention as each
thread will try to do the exact same things. Using clientNumber*num+i or
something like that would give a more realistic test if you're supposed to
be dividing up work between these threads.

Kris Jurka

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Oliver Jowett 2004-01-07 01:05:09 PreparedStatement parameters and mutable objects
Previous Message George Lessmann 2004-01-06 23:08:40 Re: odd jdbc driver synchronization issue