Re: odd jdbc driver synchronization issue - Mailing list pgsql-jdbc

From Kris Jurka
Subject Re: odd jdbc driver synchronization issue
Date
Msg-id Pine.LNX.4.33.0401061833100.6520-100000@leary.csoft.net
Whole thread Raw
In response to Re: odd jdbc driver synchronization issue  ("George Lessmann" <glessmann@hotmail.com>)
List 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


pgsql-jdbc by date:

Previous
From: "George Lessmann"
Date:
Subject: Re: odd jdbc driver synchronization issue
Next
From: Oliver Jowett
Date:
Subject: PreparedStatement parameters and mutable objects