Why does DriverManager.getConnection take 10s longer when executed in an ANT task

I have a java class with a main method that I can run via ANTs java-task.

<java classname="my.package.path.GetViews">

In the class I create a Oracle Database Connection.

logger.debug("1"); Class.forName("oracle.jdbc.driver.OracleDriver"); logger.debug("2"); Connection connection = DriverManager.getConnection(dbConnect, dbUser, dbPassword); logger.debug("3");

When running directly in Eclipse getting the connection is done in under 1 second.

// direct 13:16:12,258 DEBUG {main} [GetViews.getConnection():232] - 1 13:16:12,317 DEBUG {main} [GetViews.getConnection():234] - 2 13:16:12,640 DEBUG {main} [GetViews.getConnection():238] - 3

However, if I execute it via ANT it takes about 10 seconds to get the connection

// ant [java] 13:17:41,019 DEBUG {main} [GetViews.getConnection():?] - 1 [java] 13:17:41,030 DEBUG {main} [GetViews.getConnection():?] - 2 [java] 13:17:50,283 DEBUG {main} [GetViews.getConnection():?] - 3

The timings are absolutely consistent.

I tried different settings.

JDK 1.7.0_80 (x64 or x86) ojdbc6 or ojdbc7 ANT 1.8.4 or 1.9.5

Category:java Time:2018-10-22 Views:0

Related post

  • Why do SQL statements take so long when "limited"? 2009-04-27

    consider the following pgSQL statement: SELECT DISTINCT some_field FROM some_table WHERE some_field LIKE 'text%' LIMIT 10; Consider also, that some_table consists of several million records, and that some_field has a b-tree index. Why does the query

  • Why does Visual Studio take so long to delete a file 2008-10-08

    Why does Visual studio take so long to delete a file from the solution tree? The app freezes and sits there for what feels like an eternity. If I delete the file from the file system first, then delete it in the solution it happens instantly. Is ther

  • why does windows 8 take so long to reset on a pc or laptop? 2014-05-21

    why does windows 8 take so long to reset ? I have done allot of re-installs of windows in my over 25 years in the industry and none of them exceeds the average of 4 hours that windows 8 takes. bear in mind if installing it from a OEM disk takes about

  • Why does my pointer take so long to respond when I wake up my laptop? 2012-05-08

    My mouse pointer takes a long time to respond when I wake up my laptop from sleep mode. It also seems like it keeps taking longer and longer. I recently did a full restore to an "out of the box" state. I have only had this laptop for about three mont

  • Why does C++ compilation take so long? 2008-11-25

    Compiling a C++ file takes a very long time when compared to C# and Java. It takes significantly longer to compile a C++ file than it would to run a normal size Python script. I'm currently using VC++ but it's the same with any compiler. Why is this?

  • Why does ASP ListBox take so long to render in AJAX update panel? 2009-12-03

    I have a problem when updating the source of an ASP ListBox in an AJAX update panel. When I set the source of the ListBox to a large dataset, I would assume it would take a small amount of time to render due to the number of items. However, when the

  • Why does this pattern take a long time to match in java? 2011-09-21

    The following regex pattern, when applied to very long strings (60KB), causes java to seem to "hang". .*\Q|\E.*\Q|\E.*\Q|\E.*bundle.* I don't understand why. --------------Solutions------------- Basically, the ".*" (match any number of anything) mean

  • Why does flock occasionally take a long time on Windows / NTFS? 2009-07-14

    I use the file system to create a application wide persistent singleton (application does not use a database). Occasionally a page will take 1-2 minutes to load and I have narrowed the problem down to the use of flock in the function that gets an ins

  • Why does Android AVD take so long to start up? 2010-08-06

    I got the Hello, Android program to work after reading the tutorials from Google's developer website, but it takes SO long for the AVD to load up! Plus, in the console section in the bottom part of Eclipse, two of the lines were written in red, which

  • Why does Movie Maker take so long to save the video? 2012-06-25

    Whenever I use Movie Maker it takes so long to save the finished video. If I use other software, it does it in a few seconds. Movie maker takes about 10 minutes. Not only that but Movie Maker takes more process power and time to do the same task that

  • why does mytask bar take so long to complete my computor is very slow yet I clean the hard drive & disc every week 2013-03-08

    Why does my task bar take so long to complete ? I clean my hard drive and disc every week my computor is very slow --------------Solutions------------- And how is it if you boot to Safe Mode?

  • why does my pc take so long to connect to internet? 2014-01-21

    Why does it take so long to connect to the internet the last few days. Once i get in the computer works fine , i,m on DSL. --------------Solutions------------- Hi, I would suggest you to follow these steps and check if it helps: Method 1: Try booting

  • Why does Windows 8 take so long to boot? 2014-03-26

    Before Windows 8 was officially released, I downloaded and installed the Windows 8 Release Preview and installed it on one of my multiple extra hard drives. After I bought Windows 8 in January, I installed the full version in place of Windows 7 on my

  • Why does Outlook 2010 take so long to open attachments? 2014-07-27

    I recently installed Office 2010 and quickly noticed that it takes much longer to open attachments in Outlook. Why? Steve --------------Solutions------------- Nothing to do with Outlook, it depends what the attachments are, and the type of mail accou

  • why does deleting files take so long in Windows 7? 2014-11-17

    I am running windows 7 64 bit on a brand new high end computer wit 8Gb RAm yet deleting files takes forever. for instance I am deleting 258 files in a directory as we speak - total size of all files 458kb (yes half a megabyte) and windows tells me it

  • Why does tortoise svn take so long to update icons after commit? Fix? 2011-05-04

    This has been bugging me for years - my code is on a local hard drive and I have used tortoise SVN with Windows XP and Windows 7. After a commit tortoise SVN takes anywhere from 5 minutes to 5 days to update icons. As you can imagine this is frustrat

  • Why does my Eclipse take so long to start up? 2011-06-16

    I have Eclipse Helios 64bit with 64bit java on a 64 bit windows 7 machine. When I launch eclipse, it can take as long as 30 minutes before it comes to the workspace prompt. Once it hits the workspace prompt, everything is fine and works at normal spe

  • Why does D compilation take so long? 2011-12-26

    D is one of the fastest programming languages to compile, if not the fastest, but this isn't always the case. Things become painfully slow when unittest is turned on. My current project has 6-7 modules (~2000 LOC), with every single one of them havin

  • why does windows live take so long to load the inbox emails 2012-05-31

    When I sign ino my account it takes a long time for he new emails to load. --------------Solutions------------- Hi, The issue you posted is related to Windows Live Mail and would be better suited in the Windows Live community. Please visit the link b

Copyright (C) pcaskme.com, All Rights Reserved.

processed in 0.657 (s). 13 q(s)