db-ddlutils-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Dudziak <tom...@gmail.com>
Subject Re: Closing Database while retriving the Platform
Date Fri, 28 Oct 2005 15:29:40 GMT
On 10/28/05, Robert Einsle <robert@einsle.de> wrote:

> an aditional Question. When i retrive the Platform (Platform platform =
> PlatformFactory.createNewPlatformInstance(<Datasource));) DdlUtils
> closes the java.sql.Connection inside the Datasource. Is it possible to
> let DdlUtils not close the Conenction?

Sorry, no, because that is the recommended way of working with
datasources and connections.

> So i have to create an Connection, let create the Platform, the create
> the Connection again.

You should hold onto connections only as long as you need them, not
longer. If you have performance issues because of frequent connection
creation, consider using a pooled data source (almost every jdbc
driver comes with such an implementation). These data sources keep the
connections open internally (the call to close on the connection then
does not really close the connection but rather returns it to the


View raw message