pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Stéphane RIFF <stephane.riff@cerene.fr>
To: Kris Jurka <books@ejurka.com>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: [SPAM] - Re: [SPAM] - Re: JDBC HighLoad - Found word(s)
Date: Mon, 31 Jan 2005 14:56:22 +0100
Message-ID: <41FE3906.7010008@cerene.fr> (raw)
In-Reply-To: <Pine.BSO.4.56.0501281837510.24668@leary.csoft.net>
References: <41F75206.2030603@cerene.fr>
	<41FA1D52.4080505@cerene.fr>
	<41FA31C3.8010502@fastcrypt.com>
	<41FA39D7.1070008@cerene.fr>
	<Pine.BSO.4.56.0501281837510.24668@leary.csoft.net>

Ok so how can i make a preparedStatement pool or
allocated my preparedStatements for each connection ???

Kris Jurka wrote:

>On Fri, 28 Jan 2005, [ISO-8859-1] Stéphane RIFF wrote:
>
>  
>
>>Yes i use it as a singleon what's the problem with that ???
>>I instanciate One object => 1 pool for all threads and each thread use 
>>the saveTrame
>>    
>>
>
>The problem is you have all your preprared statements allocated in the 
>singleton instead of per connection.  This is bad because you 
>overwrite them upon each call to prepareQuery.  When you have multiple 
>threads doing this at once what will happen is the first thread will 
>prepare them and start executing, the second thread will also prepare them 
>and begin executing, but since the statements are global, you've replaced 
>the first threads versions and it will now be executing on the second 
>threads connection because it's using the global statements.  You've got 
>chaos going on here.
>
>Kris Jurka
>
>---------------------------(end of broadcast)---------------------------
>TIP 3: if posting/reading through Usenet, please send an appropriate
>      subscribe-nomail command to majordomo@postgresql.org so that your
>      message can get through to the mailing list cleanly
>
>
>  
>



-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.300 / Virus Database: 265.8.2 - Release Date: 28/01/2005




view thread (13+ messages)  latest in thread

Message-ID: <41FE3906.7010008@cerene.fr>
Permalink:  ../41FE3906.7010008@cerene.fr/
Also on:    postgresql.org/message-id/41FE3906.7010008@cerene.fr

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: stephane.riff@cerene.fr, books@ejurka.com
  Subject: Re: [SPAM] - Re: [SPAM] - Re: JDBC HighLoad - Found word(s)
  In-Reply-To: <41FE3906.7010008@cerene.fr>
  References: <41F75206.2030603@cerene.fr> <41FA1D52.4080505@cerene.fr> <41FA31C3.8010502@fastcrypt.com> <41FA39D7.1070008@cerene.fr> <Pine.BSO.4.56.0501281837510.24668@leary.csoft.net> <41FE3906.7010008@cerene.fr>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox