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

Re: [SPAM] - Re: [SPAM] - Re: JDBC HighLoad - Found word(s)

From: Stéphane RIFF <stephane(dot)riff(at)cerene(dot)fr>
To: Kris Jurka <books(at)ejurka(dot)com>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: [SPAM] - Re: [SPAM] - Re: JDBC HighLoad - Found word(s)
Date: 2005-01-31 13:56:22
Message-ID: 41FE3906.7010008@cerene.fr (view raw or flat)
Thread:
Lists: pgsql-jdbc
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(at)postgresql(dot)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


In response to

Responses

pgsql-jdbc by date

Next:From: Oliver JowettDate: 2005-01-31 19:34:38
Subject: Re: Help with exception: java.lang.IllegalArgumentException:
Previous:From: Venkatesh BabuDate: 2005-01-31 07:21:45
Subject: Help with exception: java.lang.IllegalArgumentException: \0 not allowed

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