ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steve Loughran <ste...@apache.org>
Subject Re: How to share a database connection between Tasks in ANT?
Date Mon, 12 Jun 2006 10:00:51 GMT
ashish shrivastava wrote:
> Can you elaborate


have your tasks set the connection by setting a resource

getProject().setResource("my.task.-secret-jdbc-resource",jdbcConnection);

then let them fetch it later

JDBCConnection conn=(JDBCConnection) 
getProject().getResource("my.task.-secret-jdbc-resource);

the connection will last until the project goes away. This could be a 
bit long to hold a connection open, incidentally.

By using spaces in the resource name, you shou

> 
> On 6/12/06, Jan.Materne@rzf.fin-nrw.de <Jan.Materne@rzf.fin-nrw.de> wrote:
>>
>> Only some thoughts ....
>> - datatypes support id/refid and are registered on the project
>>
>> http://svn.apache.org/repos/asf/ant/core/trunk/src/main/org/apache/tools/ant/types/

>>
>>
>> http://svn.apache.org/repos/asf/ant/core/trunk/src/main/org/apache/tools/ant/types/DataType.java

>>
>>
>>
>> Jan
>>
>> >-----Urspr√ľngliche Nachricht-----
>> >Von: ashish shrivastava [mailto:ashish.indore@gmail.com]
>> >Gesendet: Montag, 12. Juni 2006 09:10
>> >An: user@ant.apache.org
>> >Betreff: 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.
>> >
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
>> For additional commands, e-mail: user-help@ant.apache.org
>>
>>
> 
> 


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


Mime
View raw message