You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by ashish shrivastava <as...@gmail.com> on 2006/06/12 09:10:25 UTC

How to share a database connection between Tasks in ANT?

I have a set of Tasks all requiring access to the very same class
 instance (a db connection in practice). How can I implement that with
 ANT?

 So far, I have tried to implement this behaviour via a TaskContainer
 but I can't get back the TaskContainer instance from a Task, and hence
 the reference to the object I would like to share via the
 TaskContainer, as far as the TaskContainer and the Tasks are loaded in
 separate class loaders.

I  am converting a java based deploytool to ANT deployment
process.Theexisiting deploytool creates a connection pool and then
uses it subsequently
to perform any database operation.I am trying to implement the
same.myimpression of SQL Task in ANT is that i need to create a new
connection each
time for performing DB operation.