commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Phil Steitz <phil.ste...@gmail.com>
Subject Re: [dbcp] GenericObjectPool.borrowObject() hangs
Date Thu, 19 Mar 2009 20:27:36 GMT
Arun Karthik wrote:
> I just realized that the attaching file won't be possible.
> Here is the link for the source code...
>
> http://kickjava.com/src/org/quartz/utils/PoolingConnectionProvider.java.htm
>
> Regards,
> Arun
> -----Original Message-----
> From: Arun Karthik [mailto:ARavishankar@livevox.com] 
> Sent: Thursday, March 19, 2009 10:15 PM
> To: Commons Users List
> Subject: RE: [dbcp] GenericObjectPool.borrowObject() hangs
>
> Hi Phil Steitz,
>
> Thank you for your input.
> I checked the quartz source code that implements ConnectionProvider. It's called PoolingConnectionProvider
(attached) and it sets basic properties
>
>         datasource = new BasicDataSource();
>         datasource.setDriverClassName(dbDriver);
>         datasource.setUrl(dbURL);
>         datasource.setUsername(dbUser);
>         datasource.setPassword(dbPassword);
>         datasource.setMaxActive(maxConnections);
>         if (dbValidationQuery != null) {
>             datasource.setValidationQuery(dbValidationQuery);
>         }
>
> Nothing more. In your below email, when you mentioned that it should have handled SQLException,
I would like to know where exactly do you mean? Is it in the getConnection() method, or some
other place?
>   

It is the code that *uses* the connections returned by getConnection() 
that needs to handle exceptions properly and close the connection on all 
control paths. 

Phil


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


Mime
View raw message