I have a strange problem I've been breaking my head over for days now...

We have a stored procedure in SQL Server which, mainly, runs a sliding window operation on several tables (several partition functions) in our system. When the procedure is executed from sql server (by management studio, "execute stored procedure" or as a job running the procedure- "start job", and also when we created a scheduled job) it finishes in a reasonable time and without a problem. We tried moving our jobs to run from our Java program. We use a JDBC driver and just execute the command: "exec xxxx" (when xxxx is the name of the procedure). The procedure just won't finish! a 20 seconds operation is stuck for hours. When looking at the activity monitor I can see that the process is in suspend mode, and the wait type is "async_network_io". Also, I can see that the value of "network utilization" for the network in the server running the Java program gets up to 85%!

Any thought why this is happenning and what can we do?

Thank you