Re: Problems using Ant sql task
Marcel Stör <[email protected]> Tue, 4 Apr 2006 09:21:04 +0200
| Newsgroups | gmane.comp.java.anthill |
|---|---|
| Message-ID | <[email protected]> |
It continuous to amaze me, how quickly I'm getting replies on this list.
Thanks for that!
Varban wrote:
> The logic comes from the fact that you are using Windows.
> Unfortunately, processes in Windows are handled very poorly and this
> leads to the "results" you are observing. In your case, the sql task
> most likely starts a new process that executes the statements against
> the database. The problem is that this process is started in a new
> console by default and thus if you kill Tomcat this process will not
> be affected. Windows does not actually offer any decent way to
> actually end this new process once it is created (a pathetic attempt
> to create security measures on their side). That is why your process
> continued working after you stopped Tomcat.
> When you upgraded, did you remove the anthill directories from the
> webapps and work directories in the tomcat installation? Is it
> possible that you deployed the new war file via a context xml file
> and thus running two instances of Anthill at the same time?
This is not the case. We started with a clean installation on a new system
and Anthill is the only application running in Tomcat.
> It almost seems that once you stopped Tomcat, whatever was affecting
> the sql process dissapeared and the process completed successfully.
With the help of ProcessExplorer I tried to figure out what that "whatever
was affecting the sql process" could be. No success...
> Is there another application running in Tomcat that could be holding
> locks on the same tables as the sql process you are running? I also
> see that autocommit is off so any select statement would create a
> lock on the table unless you commit, could that be causing a problem?
It is on purpose that autocommit is off to span a transaction for all SQL
statements. The Ant sql task doesn't even get to open a connection to the
db; I did check that.
In the end, I gave up and replaced the sql task with
<exec dir="." executable="cmd.exe" os="Windows 2000" output="${output}">
<arg line="sqlplus ${userid}/${password}@eahvb.akbnet.be @myscript.sql" />
</exec>
-> well, it works for whatever reason!
--
Marcel Stör
http://www.frightanic.com -> free Sudoku mailing service