If it fails after a while, it could be timing out or ran out of resources like memory or dealing with locks. To rule out locks, run it when there's not many users, preferably only your connection. To rule out timeout, create a servlet with longer timeout value and special port number for your connection to connect and load the files. To rule out memory, keep an eye on resources and any out of memory errors in the logs as well.
If your unload is very big and only contain records, you want to involve your dba and do it via db tools instead.