commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From frijolita <tllor...@gmail.com>
Subject Re: StackOverflowError and DelegatingConnection.passivate
Date Wed, 20 Jun 2007 06:25:08 GMT

I think I've understood the problem but I don't know the solution yet!

The overflow is raised in the last line of this code:

List statements = getTrace();
            if( statements != null) {
                Statement[] set = new Statement[statements.size()];
                statements.toArray(set);

because statements vector is very big!

How can I avoid this?

Thanks!
T


frijolita wrote:
> 
> Hi all,
> I'm getting this error from my dbcp classes,
> any idea??
> 
> This is the way I initialize the Pool
> 
> *
> 
> connectionPool* = *new* GenericObjectPool(*null*);
> 
> Class.*forName*("com.mysql.jdbc.Driver", *true*,
> DriverManagerConnectionFactory.*class*.getClassLoader());
> 
> ConnectionFactory connectionFactory = *new*
> DriverManagerConnectionFactory(
> "jdbc:mysql://"+ip+":"+port+"/"+sid+"", usr,pwd);
> 
> PoolableConnectionFactory poolableConnectionFactory =
> *new*PoolableConnectionFactory(connectionFactory,
> *connectionPool*,*null*,*null*,*false*,*false*);
> 
> *dataSource* = *new* PoolingDataSource(*connectionPool*);
> *
> 
> public* *void* returnConnection( Connection c ) {
> 
> *try* {
> 
> *connectionPool*.returnObject(c);
> 
> } *catch* (Exception e) {
> 
> // *TODO* Auto-generated catch block
> 
> 
> 
> e.printStackTrace();
> 
> }
> 
> }
> 
> *public* Connection getConnection() *throws* Exception {
> 
> String METODO = "getConnection";
> 
> *try* {
> 
>  *return*(*dataSource*.getConnection());
> 
> } *catch*( Exception e ) {
> 
> *throw*( *new* Exception(e.toString()) );
> 
> }
> 
> }
> 
> 
> Regards
> T
> 
> java.lang.StackOverflowError
>  at java.util.ArrayList.toArray(Unknown Source)
>  at org.apache.commons.dbcp.DelegatingConnection.passivate(
> DelegatingConnection.java:374)
>  at org.apache.commons.dbcp.DelegatingConnection.passivate(
> DelegatingConnection.java:382)
>  at org.apache.commons.dbcp.DelegatingConnection.passivate(
> DelegatingConnection.java:382)
>  at org.apache.commons.dbcp.DelegatingConnection.passivate(
> DelegatingConnection.java:382)
>  at org.apache.commons.dbcp.DelegatingConnection.passivate.... etc etc
> etc...
> 
> 

-- 
View this message in context: http://www.nabble.com/StackOverflowError-and-DelegatingConnection.passivate-tf3947104.html#a11207815
Sent from the Commons - User mailing list archive at Nabble.com.


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


Mime
View raw message