ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jotpe <>
Subject Slow connection operations with java fork=false
Date Tue, 03 Dec 2013 08:53:25 GMT
Hello list,

at first my values:
Apache Ant(TM) version 1.9.2 compiled on July 8 2013
java.runtime.version : 1.7.0_45-b18 : Java HotSpot(TM) Client VM : Windows XP

I've written a Java utility class, that executes some import jobs. If
executed via commandline only OR by ant task with fork="true" parameter, it
runs as it schould: fast and without blocking.

The bottlenecks are retrieving websites
    new URL("xyz").openConnection().getInputStream()
and establishing a database connections
    DriverManager.getConnection(url, props)

With fork="true" OR direct commandline both takes ~ 50 ms +- 25 ms
With fork="false" it takes always 9047 ms +- 13 ms

The ant target looks normal, i think:

<target name="read">
    <java classname="ImportJob" fork="false" failonerror="true">
        <arg value="a" />
            <pathelement path="dist/classes"/>
            <pathelement location="dist/postgresql-9.1-903.jdbc4.jar" />
            <pathelement location="dist/commons-codec-1.7.jar" />
            <pathelement location="dist/commons-io-2.4.jar" />
            <pathelement location="dist/commons-lang3-3.1.jar" />
            <pathelement location="dist/commons-logging-1.1.1.jar" />
            <pathelement location="dist/httpclient-4.2.3.jar" />
            <pathelement location="dist/httpcore-4.2.2.jar" />
            <pathelement location="dist/utils-io-0.0.2.jar" />
            <pathelement location="dist/gson-2.2.2.jar" />

Is there somewhere an internal timeout which is reached after 9 seconds
without throwing an exception? Does anyone know this problem, is it a bug?

Best Regards Johannes

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message