Skip site navigation (1) Skip section navigation (2)

Re: Re: Concurrency supported?

From: Peter Mount <peter(at)retep(dot)org(dot)uk>
To: Joseph Shraibman <jks(at)selectacast(dot)net>, Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: Ingo Luetkebohle <ingo(at)blank(dot)pages(dot)de>, pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Re: Concurrency supported?
Date: 2001-03-01 20:23:39
Message-ID: 5.0.2.1.0.20010301202055.022a42f0@mail.retep.org.uk (view raw or flat)
Thread:
Lists: pgsql-jdbc
At 19:44 26/02/01 -0500, Joseph Shraibman wrote:
>Peter Eisentraut wrote:
> >
> > Ingo Luetkebohle writes:
> >
> > > how good is concurrency supported in the JDBC driver? For example, if
> > > I have a small process with about 50 threads, some of them requesting
> > > large objects, will one JDBC connection suffice? If one thread is
> > > executing a large select which takes seconds to execute, will other
> > > threads be able to still get their results in time or do they have to
> > > wait?
> > >
> > > In general, are there concurrency limitations in the protocol
> > > PostgreSQL uses?
> >
> > See http://www.postgresql.org/devel-corner/docs/postgres/jdbc-thread.html
> >
>
>Someone might want to add that different threads can't use the same
>connection if they are using transaction blocks.

Actually this is a common missconception with the JDBC spec. I don't know 
why they put the transaction stuff at the Connection level, but it means 
that any JDBC connection can only have one transaction.

Perhaps something along those lines, or:

You cannot use different threads while using transactions. If your 
application does a lot of queries but only a few updates, try to have the 
updates done in their own Connections, and use the Connection pool for the 
queries.

Peter



>--
>Joseph Shraibman
>jks(at)selectacast(dot)net
>Increase signal to noise ratio.  http://www.targabot.com


In response to

pgsql-jdbc by date

Next:From: Peter MountDate: 2001-03-01 21:16:59
Subject: Re: PostgresqlDataSource
Previous:From: Peter MountDate: 2001-03-01 20:04:36
Subject: Re: PATCH to org/postgresql/jdbc2/DatabaseMetaData.java

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group