Connection reset exceptions
I started getting these on a long-running command-line application, with Spring, SQL Server and DBCP for the DataSource. What I found by googling seems to point towards: a) The database times out on idle connections and resets them. Then DBCP does not know how to handle it and fails. b) A network failure causes a failure that triggers the error. The only solutions I found suggest that there is a bug in DBCP and that I should switch to the c3p0 DataSource/connection pool. But I suspect that there must be a way (perhaps through config settings) to make DBCP not have these issues. I would welcome any help that I can get. Thank you.
Re: Connection reset exceptions
you've tried supplying a validation query? On Mon, Apr 5, 2010 at 4:13 PM, Bruno Melloni bruno.mell...@chickasaw.net wrote: I started getting these on a long-running command-line application, with Spring, SQL Server and DBCP for the DataSource. What I found by googling seems to point towards: a) The database times out on idle connections and resets them. Then DBCP does not know how to handle it and fails. b) A network failure causes a failure that triggers the error. The only solutions I found suggest that there is a bug in DBCP and that I should switch to the c3p0 DataSource/connection pool. But I suspect that there must be a way (perhaps through config settings) to make DBCP not have these issues. I would welcome any help that I can get. Thank you. - To unsubscribe, e-mail: user-unsubscr...@commons.apache.org For additional commands, e-mail: user-h...@commons.apache.org
RE: Connection reset exceptions
Yup! Select 1 And the exception only happens every once in a while, not constantly. -Original Message- From: jcar...@carmanconsulting.com [mailto:jcar...@carmanconsulting.com] On Behalf Of James Carman Sent: Monday, April 05, 2010 3:17 PM To: Commons Users List Cc: Bruno Melloni Subject: Re: Connection reset exceptions you've tried supplying a validation query? On Mon, Apr 5, 2010 at 4:13 PM, Bruno Melloni bruno.mell...@chickasaw.net wrote: I started getting these on a long-running command-line application, with Spring, SQL Server and DBCP for the DataSource. What I found by googling seems to point towards: a) The database times out on idle connections and resets them. Then DBCP does not know how to handle it and fails. b) A network failure causes a failure that triggers the error. The only solutions I found suggest that there is a bug in DBCP and that I should switch to the c3p0 DataSource/connection pool. But I suspect that there must be a way (perhaps through config settings) to make DBCP not have these issues. I would welcome any help that I can get. Thank you. - To unsubscribe, e-mail: user-unsubscr...@commons.apache.org For additional commands, e-mail: user-h...@commons.apache.org
Re: Connection reset exceptions
Are you leaving the connection open while you wait for user input? On Mon, Apr 5, 2010 at 4:19 PM, Bruno Melloni bruno.mell...@chickasaw.net wrote: Yup! Select 1 And the exception only happens every once in a while, not constantly. -Original Message- From: jcar...@carmanconsulting.com [mailto:jcar...@carmanconsulting.com] On Behalf Of James Carman Sent: Monday, April 05, 2010 3:17 PM To: Commons Users List Cc: Bruno Melloni Subject: Re: Connection reset exceptions you've tried supplying a validation query? On Mon, Apr 5, 2010 at 4:13 PM, Bruno Melloni bruno.mell...@chickasaw.net wrote: I started getting these on a long-running command-line application, with Spring, SQL Server and DBCP for the DataSource. What I found by googling seems to point towards: a) The database times out on idle connections and resets them. Then DBCP does not know how to handle it and fails. b) A network failure causes a failure that triggers the error. The only solutions I found suggest that there is a bug in DBCP and that I should switch to the c3p0 DataSource/connection pool. But I suspect that there must be a way (perhaps through config settings) to make DBCP not have these issues. I would welcome any help that I can get. Thank you. - To unsubscribe, e-mail: user-unsubscr...@commons.apache.org For additional commands, e-mail: user-h...@commons.apache.org
RE: Connection reset exceptions
I am using Spring's JdbcDaoSupport. The following the code that 'sometimes' throws the exception: DataSource ds = getJdbcTemplate().getDataSource(); SimpleJdbcCall c = new SimpleJdbcCall(ds); c.withProcedureName(SP_NAME_FIND_ROWS); c.returningResultSet(rs, new GlRowMapper()); results = c.execute(inParams); There is no manual opening/closing of the connection. It is all handled by Spring. -Original Message- From: jcar...@carmanconsulting.com [mailto:jcar...@carmanconsulting.com] On Behalf Of James Carman Sent: Monday, April 05, 2010 3:22 PM To: Bruno Melloni Cc: Commons Users List Subject: Re: Connection reset exceptions Are you leaving the connection open while you wait for user input? On Mon, Apr 5, 2010 at 4:19 PM, Bruno Melloni bruno.mell...@chickasaw.net wrote: Yup! Select 1 And the exception only happens every once in a while, not constantly. -Original Message- From: jcar...@carmanconsulting.com [mailto:jcar...@carmanconsulting.com] On Behalf Of James Carman Sent: Monday, April 05, 2010 3:17 PM To: Commons Users List Cc: Bruno Melloni Subject: Re: Connection reset exceptions you've tried supplying a validation query? On Mon, Apr 5, 2010 at 4:13 PM, Bruno Melloni bruno.mell...@chickasaw.net wrote: I started getting these on a long-running command-line application, with Spring, SQL Server and DBCP for the DataSource. What I found by googling seems to point towards: a) The database times out on idle connections and resets them. Then DBCP does not know how to handle it and fails. b) A network failure causes a failure that triggers the error. The only solutions I found suggest that there is a bug in DBCP and that I should switch to the c3p0 DataSource/connection pool. But I suspect that there must be a way (perhaps through config settings) to make DBCP not have these issues. I would welcome any help that I can get. Thank you. - To unsubscribe, e-mail: user-unsubscr...@commons.apache.org For additional commands, e-mail: user-h...@commons.apache.org
Re: Connection reset exceptions
Hello, Maybe one of the reasons below.. It seems that your connection is getting closed on a time-out kind of functionality... Also, your connection details might need a recheck .I hope you are keeping a null check also as needed. Hope this helps. Regards, jd On 4/6/10, Bruno Melloni bruno.mell...@chickasaw.net wrote: I am using Spring's JdbcDaoSupport. The following the code that 'sometimes' throws the exception: DataSource ds = getJdbcTemplate().getDataSource(); SimpleJdbcCall c = new SimpleJdbcCall(ds); c.withProcedureName(SP_NAME_FIND_ROWS); c.returningResultSet(rs, new GlRowMapper()); results = c.execute(inParams); There is no manual opening/closing of the connection. It is all handled by Spring. -Original Message- From: jcar...@carmanconsulting.com [mailto:jcar...@carmanconsulting.com] On Behalf Of James Carman Sent: Monday, April 05, 2010 3:22 PM To: Bruno Melloni Cc: Commons Users List Subject: Re: Connection reset exceptions Are you leaving the connection open while you wait for user input? On Mon, Apr 5, 2010 at 4:19 PM, Bruno Melloni bruno.mell...@chickasaw.net wrote: Yup! Select 1 And the exception only happens every once in a while, not constantly. -Original Message- From: jcar...@carmanconsulting.com [mailto:jcar...@carmanconsulting.com] On Behalf Of James Carman Sent: Monday, April 05, 2010 3:17 PM To: Commons Users List Cc: Bruno Melloni Subject: Re: Connection reset exceptions you've tried supplying a validation query? On Mon, Apr 5, 2010 at 4:13 PM, Bruno Melloni bruno.mell...@chickasaw.net wrote: I started getting these on a long-running command-line application, with Spring, SQL Server and DBCP for the DataSource. What I found by googling seems to point towards: a) The database times out on idle connections and resets them. Then DBCP does not know how to handle it and fails. b) A network failure causes a failure that triggers the error. The only solutions I found suggest that there is a bug in DBCP and that I should switch to the c3p0 DataSource/connection pool. But I suspect that there must be a way (perhaps through config settings) to make DBCP not have these issues. I would welcome any help that I can get. Thank you. - To unsubscribe, e-mail: user-unsubscr...@commons.apache.org For additional commands, e-mail: user-h...@commons.apache.org - To unsubscribe, e-mail: user-unsubscr...@commons.apache.org For additional commands, e-mail: user-h...@commons.apache.org