pg.ddx.io pgsql-jdbc@postgresql.org mailing list archive
help / color / mirror / Atom feedBUG #2856: Jdbc 4 connector running on JDK 1.6 should not raise exception for getClientInfo/setClientInfo
7+ messages / 4 participants
[nested] [flat]
* BUG #2856: Jdbc 4 connector running on JDK 1.6 should not raise exception for getClientInfo/setClientInfo
@ 2006-12-22 08:35 Steve Langridge <steve@vanrhynsdorp.co.za>
2007-01-04 16:37 ` Re: BUG #2856: Jdbc 4 connector running on JDK 1.6 should Kris Jurka <books@ejurka.com>
0 siblings, 1 reply; 7+ messages in thread
From: Steve Langridge @ 2006-12-22 08:35 UTC (permalink / raw)
To: pgsql-bugs@postgresql.org
The following bug has been logged online:
Bug reference: 2856
Logged by: Steve Langridge
Email address: steve@vanrhynsdorp.co.za
PostgreSQL version: 8.2
Operating system: Windows XP Pro SP2
Description: Jdbc 4 connector running on JDK 1.6 should not raise
exception for getClientInfo/setClientInfo
Details:
When using the Jdbc 4 driver running on Java 1.6, it would be preferable if
the methods getClientInfo() and setClientInfo() returned silently, instead
of raising an exception about not being implemented. When running on
Glassfish with Toplink Essentials, the app server log gets filled with these
exceptions for every access from a JDBC connection pool (when using the
PGConnectionPoolDataSource).
This has been discussed on the Nabble forums, but I do not see that it has
been posted anywhere on the Postgres forums.
Regards,
Steve.
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: BUG #2856: Jdbc 4 connector running on JDK 1.6 should
2006-12-22 08:35 BUG #2856: Jdbc 4 connector running on JDK 1.6 should not raise exception for getClientInfo/setClientInfo Steve Langridge <steve@vanrhynsdorp.co.za>
@ 2007-01-04 16:37 ` Kris Jurka <books@ejurka.com>
2007-01-05 17:25 ` Re: BUG #2856: Jdbc 4 connector running on JDK 1.6 should Kris Jurka <books@ejurka.com>
0 siblings, 1 reply; 7+ messages in thread
From: Kris Jurka @ 2007-01-04 16:37 UTC (permalink / raw)
To: Steve Langridge <steve@vanrhynsdorp.co.za>; +Cc: pgsql-bugs@postgresql.org; pgsql-jdbc
On Fri, 22 Dec 2006, Steve Langridge wrote:
> Bug reference: 2856
> PostgreSQL version: 8.2
> Description: Jdbc 4 connector running on JDK 1.6 should not raise
> exception for getClientInfo/setClientInfo
> Details:
>
> When using the Jdbc 4 driver running on Java 1.6, it would be preferable if
> the methods getClientInfo() and setClientInfo() returned silently, instead
> of raising an exception about not being implemented. When running on
> Glassfish with Toplink Essentials, the app server log gets filled with these
> exceptions for every access from a JDBC connection pool (when using the
> PGConnectionPoolDataSource).
>
I'm not sure it's legal to simply ignore the fact that the method is not
implemented. I think at minimum we'd need to keep the client info data in
the Connection object even if we don't send it to the database. This
would make it look like it was working to the JVM there just wouldn't be a
way to get at it on the database side.
Kris Jurka
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: BUG #2856: Jdbc 4 connector running on JDK 1.6 should
2006-12-22 08:35 BUG #2856: Jdbc 4 connector running on JDK 1.6 should not raise exception for getClientInfo/setClientInfo Steve Langridge <steve@vanrhynsdorp.co.za>
2007-01-04 16:37 ` Re: BUG #2856: Jdbc 4 connector running on JDK 1.6 should Kris Jurka <books@ejurka.com>
@ 2007-01-05 17:25 ` Kris Jurka <books@ejurka.com>
0 siblings, 0 replies; 7+ messages in thread
From: Kris Jurka @ 2007-01-05 17:25 UTC (permalink / raw)
To: Steve Langridge <steve@vanrhynsdorp.co.za>; +Cc: pgsql-bugs@postgresql.org; pgsql-jdbc
On Fri, 5 Jan 2007, Steve Langridge wrote:
> At the present time, I am not really interested in actually using the client
> info data at all - I really just need the getClientInfo() and setClientInfo()
> to rather not raise a not-implemented exception. With the JDBC 3 driver
> under Java 1.5, there were no problems, so I presume these methods were
> implemented - it is now a real hassle since when running under Java 1.6, one
> has to use the JDBC 4 driver.
>
These methods are new in JDBC 4 which is why it wasn't a problem with JDBC
3. I understand that all you want is not to error, but I don't think
that's appropriate behavior for all users.
Kris Jurka
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: [BUGS] BUG #2856: Jdbc 4 connector running on JDK 1.6 should
@ 2007-09-28 13:13 Mike C. <mcbp223@yahoo.com>
2007-10-07 19:48 ` Re: [BUGS] BUG #2856: Jdbc 4 connector running on JDK 1.6 should Kris Jurka <books@ejurka.com>
0 siblings, 1 reply; 7+ messages in thread
From: Mike C. @ 2007-09-28 13:13 UTC (permalink / raw)
To: pgsql-jdbc
Kris Jurka <books@ejurka.com> wrote:
On Fri, 5 Jan 2007, Steve Langridge wrote:
> At the present time, I am not really interested in actually using the client
> info data at all - I really just need the getClientInfo() and setClientInfo()
> to rather not raise a not-implemented exception. With the JDBC 3 driver
> under Java 1.5, there were no problems, so I presume these methods were
> implemented - it is now a real hassle since when running under Java 1.6, one
> has to use the JDBC 4 driver.
>
These methods are new in JDBC 4 which is why it wasn't a problem with JDBC
3. I understand that all you want is not to error, but I don't think
that's appropriate behavior for all users.
Kris Jurka
This is getting old, would you accept the naive implementation and leave the bug open until someone implements the real logic? It's really a showstopper on Glassfish / JDK 1.6
(AbstractJdbc4Connection.java)
private Properties clientInfo = null;
public void setClientInfo(String name, String value) throws SQLClientInfoException
{
if(clientInfo == null)
clientInfo = new Properties();
clientInfo.setProperty(name, value);
//throw new SQLClientInfoException("Not implemented.", null);
}
public void setClientInfo(Properties properties) throws SQLClientInfoException
{
clientInfo = properties;
//throw new SQLClientInfoException("Not implemented.", null);
}
public String getClientInfo(String name) throws SQLException
{
if(clientInfo == null)
return null;
return clientInfo.getProperty(name);
//throw org.postgresql.Driver.notImplemented(this.getClass(), "getClientInfo(String)");
}
public Properties getClientInfo() throws SQLException
{
return clientInfo;
//throw org.postgresql.Driver.notImplemented(this.getClass(), "getClientInfo()");
}
---------------------------------
Boardwalk for $500? In 2007? Ha!
Play Monopoly Here and Now (it's updated for today's economy) at Yahoo! Games.
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: [BUGS] BUG #2856: Jdbc 4 connector running on JDK 1.6 should
2007-09-28 13:13 Re: [BUGS] BUG #2856: Jdbc 4 connector running on JDK 1.6 should Mike C. <mcbp223@yahoo.com>
@ 2007-10-07 19:48 ` Kris Jurka <books@ejurka.com>
2007-10-07 22:58 ` Re: [BUGS] BUG #2856: Jdbc 4 connector running on JDK 1.6 should Mike C. <mcbp223@yahoo.com>
0 siblings, 1 reply; 7+ messages in thread
From: Kris Jurka @ 2007-10-07 19:48 UTC (permalink / raw)
To: Mike C. <mcbp223@yahoo.com>; +Cc: pgsql-jdbc
On Fri, 28 Sep 2007, Mike C. wrote:
> On Fri, 5 Jan 2007, Steve Langridge wrote:
>
>> At the present time, I am not really interested in actually using the client
>> info data at all - I really just need the getClientInfo() and setClientInfo()
>> to rather not raise a not-implemented exception. With the JDBC 3 driver
>> under Java 1.5, there were no problems, so I presume these methods were
>> implemented - it is now a real hassle since when running under Java 1.6, one
>> has to use the JDBC 4 driver.
>>
>
> This is getting old, would you accept the naive implementation and
> leave the bug open until someone implements the real logic? It's really
> a showstopper on Glassfish / JDK 1.6
>
I've implemented this in a similar fashion. The Javadoc spec indicates
that setting a clientinfo property that isn't supported is an error, so
I've done that. So now it won't throw an error on getClientInfo or
setClientInfo with a null or empty properties. Can you test this jar file
and see if it works for you?
http://ejurka.com/pgsql/jars/clientinfo/
Kris Jurka
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: [BUGS] BUG #2856: Jdbc 4 connector running on JDK 1.6 should
2007-09-28 13:13 Re: [BUGS] BUG #2856: Jdbc 4 connector running on JDK 1.6 should Mike C. <mcbp223@yahoo.com>
2007-10-07 19:48 ` Re: [BUGS] BUG #2856: Jdbc 4 connector running on JDK 1.6 should Kris Jurka <books@ejurka.com>
@ 2007-10-07 22:58 ` Mike C. <mcbp223@yahoo.com>
0 siblings, 0 replies; 7+ messages in thread
From: Mike C. @ 2007-10-07 22:58 UTC (permalink / raw)
To: pgsql-jdbc
Kris Jurka <books@ejurka.com> wrote:
On Fri, 28 Sep 2007, Mike C. wrote:
> On Fri, 5 Jan 2007, Steve Langridge wrote:
>
>> At the present time, I am not really interested in actually using the client
>> info data at all - I really just need the getClientInfo() and setClientInfo()
>> to rather not raise a not-implemented exception. With the JDBC 3 driver
>> under Java 1.5, there were no problems, so I presume these methods were
>> implemented - it is now a real hassle since when running under Java 1.6, one
>> has to use the JDBC 4 driver.
>>
>
> This is getting old, would you accept the naive implementation and
> leave the bug open until someone implements the real logic? It's really
> a showstopper on Glassfish / JDK 1.6
>
I've implemented this in a similar fashion. The Javadoc spec indicates
that setting a clientinfo property that isn't supported is an error, so
I've done that. So now it won't throw an error on getClientInfo or
setClientInfo with a null or empty properties. Can you test this jar file
and see if it works for you?
http://ejurka.com/pgsql/jars/clientinfo/
Kris Jurka
Hi, thanks Michael and Kris for your replies. I have tested your jar and it's allright, the log file is clean and the application works as expected, this with Glassfish build b41d I currently use. I will test later with a more recent build, but I don't expect any different behavior.
---------------------------------
Yahoo! oneSearch: Finally, mobile search that gives answers, not web links.
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: [BUGS] BUG #2856: Jdbc 4 connector running on JDK 1.6 should
@ 2007-09-28 13:47 Thor-Michael Støre <thor-michael.store@webvelocity.no>
0 siblings, 0 replies; 7+ messages in thread
From: Thor-Michael Støre @ 2007-09-28 13:47 UTC (permalink / raw)
To: Mike C. <mcbp223@yahoo.com>; pgsql-jdbc
Hey,
On Fri, 5 Jan 2007, Steve Langridge wrote:
> At the present time, I am not really interested in actually using the client
> info data at all - I really just need the getClientInfo() and setClientInfo()
> to rather not raise a not-implemented exception. With the JDBC 3 driver
> under Java 1.5, there were no problems, so I presume these methods were
> implemented - it is now a real hassle since when running under Java 1.6, one
> has to use the JDBC 4 driver.
>
FYI, the Glassfish folks added an option to V2 so that one can run it on JDK 1.6 with JDBC 3 drivers. https://glassfish.dev.java.net/issues/show_bug.cgi?id=2779
Ofcourse, this doesn't help those who are on V1 or you need features in JDBC 4......
- thormick
^ permalink raw reply [nested|flat] 7+ messages in thread
end of thread, other threads:[~2007-10-07 22:58 UTC | newest]
Thread overview: 7+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2006-12-22 08:35 BUG #2856: Jdbc 4 connector running on JDK 1.6 should not raise exception for getClientInfo/setClientInfo Steve Langridge <steve@vanrhynsdorp.co.za>
2007-01-04 16:37 ` Re: BUG #2856: Jdbc 4 connector running on JDK 1.6 should Kris Jurka <books@ejurka.com>
2007-01-05 17:25 ` Re: BUG #2856: Jdbc 4 connector running on JDK 1.6 should Kris Jurka <books@ejurka.com>
2007-09-28 13:13 Re: [BUGS] BUG #2856: Jdbc 4 connector running on JDK 1.6 should Mike C. <mcbp223@yahoo.com>
2007-10-07 19:48 ` Re: [BUGS] BUG #2856: Jdbc 4 connector running on JDK 1.6 should Kris Jurka <books@ejurka.com>
2007-10-07 22:58 ` Re: [BUGS] BUG #2856: Jdbc 4 connector running on JDK 1.6 should Mike C. <mcbp223@yahoo.com>
2007-09-28 13:47 Re: [BUGS] BUG #2856: Jdbc 4 connector running on JDK 1.6 should Thor-Michael Støre <thor-michael.store@webvelocity.no>
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