pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Achilleas Mantzios <achill@matrix.gatewaynet.com>
To: pgsql-jdbc@postgresql.org
Cc: Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>
Cc: jboss-user@lists.jboss.org
Subject: Re: Very Dangerous bug in XA connection pooling and SL EJBs with jboss-4.2.3 & latest postgresql-8.4-701.jdbc3.jar
Date: Wed, 3 Mar 2010 12:09:40 +0200
Message-ID: <201003031209.41358.achill@matrix.gatewaynet.com> (raw)
In-Reply-To: <4B8E23DD.6040101@enterprisedb.com>
References: <201003011731.15724.achill@matrix.gatewaynet.com>
	<201003031034.44077.achill@matrix.gatewaynet.com>
	<4B8E23DD.6040101@enterprisedb.com>

Στις Wednesday 03 March 2010 10:54:53 ο/η Heikki Linnakangas έγραψε:
> Achilleas Mantzios wrote:
> > i'll try to make a test case, but i think now there is enuf material for anyone to make his own case,
> > please ask whatever i may have missed, and thank you for your attention.
> 
> If you can set logLevel to DEBUG (ie. loglevel=2 in connection string),
> run the code, and send over the logs, that would help a lot. From that
> we should see what exactly is the sequence of XA commands the JDBC
> driver is receiving from JBoss.
> 

As loglevel configuration property to org.postgresql.ds.common.BaseDataSource  is not supported in the lastest driver, 
i made this patch (i attach it) against postgresql-jdbc-8.4-701.src, also i set in jboss 

<datasources>
   <xa-datasource>
     <jndi-name>pgsql</jndi-name>
     <use-java-context>true</use-java-context>
     <xa-datasource-class>org.postgresql.xa.PGXADataSource</xa-datasource-class>
     <xa-datasource-property name="ServerName">localhost</xa-datasource-property>
     <xa-datasource-property name="PortNumber">5432</xa-datasource-property>
     <xa-datasource-property name="DatabaseName">dynacom</xa-datasource-property>
     <xa-datasource-property name="User">postgres</xa-datasource-property>
     <xa-datasource-property name="Password">xxxx</xa-datasource-property>
     <xa-datasource-property name="Compatible">8.2</xa-datasource-property>
     <xa-datasource-property name="Loglevel">2</xa-datasource-property>
     <track-connection-by-tx/>
     <min-pool-size>1</min-pool-size>
     <max-pool-size>2</max-pool-size>
     <metadata>
         <type-mapping>PostgreSQL 8.0</type-mapping>
     </metadata>
   </xa-datasource>
</datasources>

But i dont see anything spectacular comming out of PostgreSQL logs. 
in postgresql.conf I have set 
client_min_messages = debug5
log_min_messages = debug5

however playing with <xa-datasource-property name="Loglevel"></xa-datasource-property> does not seem to change a thing.
Am i missing something?

> -- 
>   Heikki Linnakangas
>   EnterpriseDB   http://www.enterprisedb.com
> 



-- 
Achilleas Mantzios

Attachments:

loglevel.patch (text/x-diff, 1.8K) download --- org/postgresql/ds/common/BaseDataSource.java.orig 2009-06-20 18:19:40.000000000 +0300 +++ org/postgresql/ds/common/BaseDataSource.java 2010-03-03 11:44:38.000000000 +0200 @@ -55,6 +55,7 @@ private String sslfactory; private boolean tcpKeepAlive = false; private String compatible; + private String loglevel; /** * Gets a connection to the PostgreSQL database. The database is identified by the @@ -168,6 +169,16 @@ this.compatible = compatible; } + public String getLoglevel() + { + return loglevel; + } + + public void setLoglevel(String compatible) + { + this.loglevel = loglevel; + } + /** * Gets the name of the PostgreSQL database, running on the server identified * by the serverName property. @@ -380,6 +391,9 @@ if (compatible != null) { sb.append("&compatible="+compatible); } + if (loglevel != null) { + sb.append("&loglevel="+loglevel); + } return sb.toString(); } @@ -425,6 +439,10 @@ { ref.add(new StringRefAddr("compatible", compatible)); } + if (loglevel != null) + { + ref.add(new StringRefAddr("loglevel", loglevel)); + } return ref; } @@ -444,6 +462,7 @@ out.writeObject(sslfactory); out.writeBoolean(tcpKeepAlive); out.writeObject(compatible); + out.writeObject(loglevel); } protected void readBaseObject(ObjectInputStream in) throws IOException, ClassNotFoundException @@ -461,6 +480,7 @@ sslfactory = (String)in.readObject(); tcpKeepAlive = in.readBoolean(); compatible = (String)in.readObject(); + loglevel = (String)in.readObject(); } }

view thread (13+ messages)  latest in thread

Message-ID: <201003031209.41358.achill@matrix.gatewaynet.com>
Permalink:  ../201003031209.41358.achill@matrix.gatewaynet.com/
Also on:    postgresql.org/message-id/201003031209.41358.achill@matrix.gatewaynet.com

 ·  · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: achill@matrix.gatewaynet.com, pgsql-jdbc@postgresql.org, heikki.linnakangas@enterprisedb.com, jboss-user@lists.jboss.org
  Subject: Re: Very Dangerous bug in XA connection pooling and SL EJBs with jboss-4.2.3 & latest postgresql-8.4-701.jdbc3.jar
  In-Reply-To: <201003031209.41358.achill@matrix.gatewaynet.com>

* 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