Originally posted by Jeanne Boyarsky:
Mike,
A few comments:
1) Try executing the loop with a different prepared statement. For example, try with one that just does a select. This will provide more clues as to the problem.
2) If you are calling this alot of times in production, consider not making it synchronized or executing multiple inserts in a batch.
3) The "ps = null" statement doesn't do anything as the ps variable is about to go out of scope anyway. This isn't the problem, but it's good to know.
Thanks for the input. Re # 3, that is actually left over code from when I thought the issue might be garbage collection and was trying to force earlier cleanup.
I made it synchronized to allow for multi-threading, though that isn't an issue yet.
Batching the inserts is a good idea, that might at least reduce the issue.
I'll also try using selects instead.
One last thing is this used to work OK before I started using the JRE that came with
J2EE. I think I'll give 1.5 a shot and see what happens.
ms