Re: How different is AWS-RDS postgres?

From: Rob Sargent <robjsargent(at)gmail(dot)com>
To: Sam Gendler <sgendler(at)ideasculptor(dot)com>
Cc: Philip Semanchuk <philip(at)americanefficient(dot)com>, Ian Harding <harding(dot)ian(at)gmail(dot)com>, Ron <ronljohnsonjr(at)gmail(dot)com>, "pgsql-generallists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: How different is AWS-RDS postgres?
Date: 2021-05-27 22:35:41
Message-ID: 1c323f49-ae05-b5a1-f3ef-518130eb892a@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 5/27/21 4:25 PM, Sam Gendler wrote:
> That sure looks like something is causing your connection to have a
> transaction rollback.  I haven't worked in Java in far too long, but
> it seems like your connection pool is under the impression your
> connection was abandoned so it reclaims it and rollback the
> transaction, which would explain why you aren't seeing the table when
> all is said and done - all of the work is being undone at the end.
>
> One possibility, based on the catalina log you provided - if you have
> either end of the connection set up to automatically close idle
> connections after a period of time, then you might receive a closed
> connection from the pool, which will just error out when you attempt
> to run a query. In which case, you need to set up your connection pool
> to test a connection before it returns it to the requester.  Usually
> something as simple as "select 2" will be sufficient to determine if
> the database connection is open. I can just about guarantee that your
> connection pool has a parameter which allows you to specify a query to
> execute when a connection is requested.
>

Well I /was/ doing

contextResource.setProperty("validationQuery", "SELECT 1");

but I see that I lost that when I switched to using a properties file. 
Thanks for point me there.

The loop of 16 insert statement is in a single transaction, single
connection so I'm not sure who's choking first.  Is the connection idle
after the I/O error or is the I/O error from a dead connection?  (Small
disclaimer:  there is no catalina involved here, just an embedded tomcat
instance.)

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2021-05-27 23:06:51 Re: How long to get a password reset ???
Previous Message Sam Gendler 2021-05-27 22:31:18 Re: How different is AWS-RDS postgres?