Since you're using Hibernate, it
could be a Session filling up, as it usually exhibits that kind of symptom. You'd then need to flush() and clear() the session regularly.
But as others have answered,
you should be profiling to make sure it's the problem: doing a simple
thread dump while the processing drags on might be enough to see in which part of the code it's taking time. Obviously, since you have a performance problem, what you think should work is
not what actually works.