[jira] [Created] (DBCP-365) StackOverflowError SharedPoolDataSource.getPooledConnectionAndInfo() Postgresql

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Created] (DBCP-365) StackOverflowError SharedPoolDataSource.getPooledConnectionAndInfo() Postgresql

Gilles (Jira)
StackOverflowError SharedPoolDataSource.getPooledConnectionAndInfo() Postgresql
-------------------------------------------------------------------------------

                 Key: DBCP-365
                 URL: https://issues.apache.org/jira/browse/DBCP-365
             Project: Commons Dbcp
          Issue Type: Bug
    Affects Versions: 1.4
         Environment: Windows XP 64-bit multi-threaded
            Reporter: Axl



This might be a problem with the JDBC driver for PostgreSQL 9.1 but it also shows up here. Since this is a StackOverflowError there isn't much information about what specifically is causing this. I'm guessing it's a Class.forName() for one of the org.postgresql.* classes but not sure which one. The Class.forName() goes into a loop which throws the StackOverflowError.


SharedPoolDataSource.getPooledConnectionAndInfo(String, String) line: 174
SharedPoolDataSource(InstanceKeyDataSource).getConnection(String, String) line: 701
SharedPoolDataSource(InstanceKeyDataSource).getConnection() line: 676



                        spds = new org.apache.commons.dbcp.datasources.SharedPoolDataSource();
                        cpds = new org.apache.commons.dbcp.cpdsadapter.DriverAdapterCPDS();
                        cpds.setDriver("org.postgresql.Driver");
                        cpds.setUrl("jdbc:postgresql://localhost:1234/mydatabasename");
                        cpds.setUser("myuser");
                        cpds.setPassword("mypass");
                        spds.setConnectionPoolDataSource(cpds);
                        spds.setMaxActive(30);
                        spds.setMaxWait(50);
                               
                        conn = spds.getConnection();


--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

       
Reply | Threaded
Open this post in threaded view
|

[jira] [Commented] (DBCP-365) StackOverflowError SharedPoolDataSource.getPooledConnectionAndInfo() Postgresql

Gilles (Jira)

    [ https://issues.apache.org/jira/browse/DBCP-365?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13107280#comment-13107280 ]

Phil Steitz commented on DBCP-365:
----------------------------------

I can't reproduce this using the build 901 postgres 9.1 jdbc driver.  What driver, exactly are you using, what JDK and what versions of commons pool and DBCP? If you are using DBCP 1.4, you should be using the JDBC 4 driver and JDK 1.6+

> StackOverflowError SharedPoolDataSource.getPooledConnectionAndInfo() Postgresql
> -------------------------------------------------------------------------------
>
>                 Key: DBCP-365
>                 URL: https://issues.apache.org/jira/browse/DBCP-365
>             Project: Commons Dbcp
>          Issue Type: Bug
>    Affects Versions: 1.4
>         Environment: Windows XP 64-bit multi-threaded
>            Reporter: Axl
>              Labels: JDBC, postgresql
>
> This might be a problem with the JDBC driver for PostgreSQL 9.1 but it also shows up here. Since this is a StackOverflowError there isn't much information about what specifically is causing this. I'm guessing it's a Class.forName() for one of the org.postgresql.* classes but not sure which one. The Class.forName() goes into a loop which throws the StackOverflowError.
> SharedPoolDataSource.getPooledConnectionAndInfo(String, String) line: 174
> SharedPoolDataSource(InstanceKeyDataSource).getConnection(String, String) line: 701
> SharedPoolDataSource(InstanceKeyDataSource).getConnection() line: 676
> spds = new org.apache.commons.dbcp.datasources.SharedPoolDataSource();
> cpds = new org.apache.commons.dbcp.cpdsadapter.DriverAdapterCPDS();
> cpds.setDriver("org.postgresql.Driver");
> cpds.setUrl("jdbc:postgresql://localhost:1234/mydatabasename");
> cpds.setUser("myuser");
> cpds.setPassword("mypass");
> spds.setConnectionPoolDataSource(cpds);
> spds.setMaxActive(30);
> spds.setMaxWait(50);
>
> conn = spds.getConnection();

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

       
Reply | Threaded
Open this post in threaded view
|

[jira] [Commented] (DBCP-365) StackOverflowError SharedPoolDataSource.getPooledConnectionAndInfo() Postgresql

Gilles (Jira)
In reply to this post by Gilles (Jira)

    [ https://issues.apache.org/jira/browse/DBCP-365?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13112856#comment-13112856 ]

Axl commented on DBCP-365:
--------------------------

Hi this turns out to be a permissions issue on the .jar files. The improvement I would like to see is, added logging for Class.forName(), or added handling of Throwable instead of only Exceptions. Looking at the source I see handling of exceptions however errors are not caught. So whatever your recommendation would be here. Could for example wrap all Class.forName() calls. Or a larger effort would be catching Throwable everywhere. This could be made lower priority, unless it turns out others are experiencing this issue. Whatever you think, I don't do all that much Java so it's your call.

> StackOverflowError SharedPoolDataSource.getPooledConnectionAndInfo() Postgresql
> -------------------------------------------------------------------------------
>
>                 Key: DBCP-365
>                 URL: https://issues.apache.org/jira/browse/DBCP-365
>             Project: Commons Dbcp
>          Issue Type: Bug
>    Affects Versions: 1.4
>         Environment: Windows XP 64-bit multi-threaded
>            Reporter: Axl
>              Labels: JDBC, postgresql
>
> This might be a problem with the JDBC driver for PostgreSQL 9.1 but it also shows up here. Since this is a StackOverflowError there isn't much information about what specifically is causing this. I'm guessing it's a Class.forName() for one of the org.postgresql.* classes but not sure which one. The Class.forName() goes into a loop which throws the StackOverflowError.
> SharedPoolDataSource.getPooledConnectionAndInfo(String, String) line: 174
> SharedPoolDataSource(InstanceKeyDataSource).getConnection(String, String) line: 701
> SharedPoolDataSource(InstanceKeyDataSource).getConnection() line: 676
> spds = new org.apache.commons.dbcp.datasources.SharedPoolDataSource();
> cpds = new org.apache.commons.dbcp.cpdsadapter.DriverAdapterCPDS();
> cpds.setDriver("org.postgresql.Driver");
> cpds.setUrl("jdbc:postgresql://localhost:1234/mydatabasename");
> cpds.setUser("myuser");
> cpds.setPassword("mypass");
> spds.setConnectionPoolDataSource(cpds);
> spds.setMaxActive(30);
> spds.setMaxWait(50);
>
> conn = spds.getConnection();

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira