You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Administrator <ad...@uslugodawcy-weselni.pl> on 2010/11/24 13:00:39 UTC

[dbcp] Problem with first update statement after Tomcat restart

Hi gurus,

Every time I restart Tomcat, the first transaction trying to modify data  
gets stuck in "in transaction" state.

I'm running the following configuration on Gentoo:

Postgresql 8.4.4
Apache Tomcat/6.0.18
JVM: 1.6.0_13-b03
commons-dbcp-1.4
commons-pool-1.5.5

This is how I configured my connection pool:


<Context>

  <Resource name="jdbc/weddingDataSource"
  auth="Container"
  type="javax.sql.DataSource"
  factory="org.apache.commons.dbcp.BasicDataSourceFactory"
  driverClassName="org.postgresql.Driver"
url="jdbc:postgresql://127.0.0.1:5432/myApplication"
username="user" password="password"

  maxActive="-1"
  maxIdle="20"
  maxWait="10000"
  removeAbandoned="true"
  removeAbandonedTimeout="6"
  logAbandoned="true"
  initialSize="20"
  validationQuery="select 1"/>

</Context>


It's enough to close this faulty browser session or to kill the stuck  
process and from then on things seem to work fine.

Any help would be much appreciated.

Kind regards,
Remik

Re: [dbcp] Problem with first update statement after Tomcat restart

Posted by Administrator <ad...@uslugodawcy-weselni.pl>.
Hi Phil,

Thank you for your kind reply.

When I started preparing code snippets to send back to you, I came across  
a suspicious section in my code.

After a bit of analysis it turned out that it's a thread synchronization  
issue - nothing to do with DBCP.

I fixed the problem and DBCP seems working fine for me now.

Thank you for pointing me into right direction.

Regards,
Remik



On Wed, 24 Nov 2010 18:39:40 +0100, Phil Steitz <ph...@gmail.com>  
wrote:

> 2010/11/24 Administrator <ad...@uslugodawcy-weselni.pl>
>
>> Hi gurus,
>>
>> Every time I restart Tomcat, the first transaction trying to modify data
>> gets stuck in "in transaction" state.
>>
>> I'm running the following configuration on Gentoo:
>>
>> Postgresql 8.4.4
>> Apache Tomcat/6.0.18
>> JVM: 1.6.0_13-b03
>> commons-dbcp-1.4
>> commons-pool-1.5.5
>>
>> This is how I configured my connection pool:
>>
>>
>> <Context>
>>
>> <Resource name="jdbc/weddingDataSource"
>> auth="Container"
>> type="javax.sql.DataSource"
>> factory="org.apache.commons.dbcp.BasicDataSourceFactory"
>> driverClassName="org.postgresql.Driver"
>> url="jdbc:postgresql://127.0.0.1:5432/myApplication"
>> username="user" password="password"
>>
>> maxActive="-1"
>> maxIdle="20"
>> maxWait="10000"
>> removeAbandoned="true"
>> removeAbandonedTimeout="6"
>> logAbandoned="true"
>> initialSize="20"
>> validationQuery="select 1"/>
>>
>> </Context>
>>
>>
>> It's enough to close this faulty browser session or to kill the stuck
>> process and from then on things seem to work fine.
>>
>> Any help would be much appreciated.
>>
>
>
> Can you post the code that is acquiring and using the connection that is
> attempting the update?
>
> Phil
>
>>
>> Kind regards,
>> Remik
>>


-- 
Using Opera's revolutionary email client: http://www.opera.com/mail/

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Re: [dbcp] Problem with first update statement after Tomcat restart

Posted by Phil Steitz <ph...@gmail.com>.
2010/11/24 Administrator <ad...@uslugodawcy-weselni.pl>

> Hi gurus,
>
> Every time I restart Tomcat, the first transaction trying to modify data
> gets stuck in "in transaction" state.
>
> I'm running the following configuration on Gentoo:
>
> Postgresql 8.4.4
> Apache Tomcat/6.0.18
> JVM: 1.6.0_13-b03
> commons-dbcp-1.4
> commons-pool-1.5.5
>
> This is how I configured my connection pool:
>
>
> <Context>
>
> <Resource name="jdbc/weddingDataSource"
> auth="Container"
> type="javax.sql.DataSource"
> factory="org.apache.commons.dbcp.BasicDataSourceFactory"
> driverClassName="org.postgresql.Driver"
> url="jdbc:postgresql://127.0.0.1:5432/myApplication"
> username="user" password="password"
>
> maxActive="-1"
> maxIdle="20"
> maxWait="10000"
> removeAbandoned="true"
> removeAbandonedTimeout="6"
> logAbandoned="true"
> initialSize="20"
> validationQuery="select 1"/>
>
> </Context>
>
>
> It's enough to close this faulty browser session or to kill the stuck
> process and from then on things seem to work fine.
>
> Any help would be much appreciated.
>


Can you post the code that is acquiring and using the connection that is
attempting the update?

Phil

>
> Kind regards,
> Remik
>