New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only execute "SET application_name" if name has changed #537

Closed
wants to merge 1 commit into
base: master
from

Conversation

Projects
None yet
4 participants
@rcpoison

rcpoison commented Mar 17, 2016

glassfish3's connection pool implementation insist on calling setClientInfo:

  • after connecting
  • when getting a pooled connection
  • when returning a connection to the pool
  • before every statement

While this is clearly ... erm ... "suboptimal behaviour" in glassfish,
I don't see a reason to issue the query if ApplicationName hasn't changed.

Also see: http://www.postgresql.org/message-id/flat/CADK3HHJKRq09otwqtv3rtnDh9h_LqFvBz+BHKgHjZgtnybvF1g@mail.gmail.com

@vlsi

This comment has been minimized.

Member

vlsi commented Mar 17, 2016

Technically speaking, it is required to catch ParameterStatus(application_name=... and update PgConnection._clientInfo cache accordingly. Otherwise mix of setClientInfo and direct sql set application name... would get inconsistent results.

I mean something around

@rcpoison , can you please do that as well?

@rcpoison

This comment has been minimized.

rcpoison commented Mar 17, 2016

oops, checkstyle :(
@vlsi That code does look a bit more intimidating, but I'll give it a try.

Andreas Schnaiter
Only execute "SET application_name" if name has changed
glassfish3's connection pool implementation insist on calling setClientInfo:
- after connecting
- when getting a pooled connection
- when returning a connection to the pool
- before every statement

While this is clearly ... erm ... "suboptimal behaviour" in glassfish,
I don't see a reason to issue the query if ApplicationName hasn't changed.

@rcpoison rcpoison force-pushed the rcpoison:feature/client-info branch from 00bab75 to 8bbe3a9 Mar 17, 2016

@codecov-io

This comment has been minimized.

codecov-io commented Mar 17, 2016

Current coverage is 57.46%

Merging #537 into master will increase coverage by +0.01% as of 40e4fd7

@@            master    #537   diff @@
======================================
  Files          143     143       
  Stmts        15129   15132     +3
  Branches      2971    2972     +1
  Methods          0       0       
======================================
+ Hit           8693    8696     +3
  Partial       1180    1180       
  Missed        5256    5256       

Review entire Coverage Diff as of 40e4fd7

Powered by Codecov. Updated on successful CI builds.

@davecramer

This comment has been minimized.

Member

davecramer commented May 10, 2016

@rcpoison any progress with @vlsi request above ?

@vlsi vlsi closed this in 893c1a4 Jun 22, 2016

@vlsi vlsi added this to the 9.4.1209 milestone Jun 22, 2016

zemian pushed a commit to zemian/pgjdbc that referenced this pull request Oct 6, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment