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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to