Leaving a transaction open and waiting for user intervention is usually a bad idea. You might want to re-think what you're doing. If you can (if it's not a lot of data), you might want to gather up everything you need to perform the transaction and store it in the session. Then, at the end, you use that information to perform the entire transaction during one request. If the user closes their browser or their session times out, the data for the transaction is lost. You could actually save the data in the database (marking it as temporary or provisional somehow) and listen for session timeout events (via an HttpSessionListener) to clean it up. However you do it, I would NOT leave open a
JDBC connection to the database while waiting for the user to do something. That can be quite a resource hog, especially if your session-timeout value is large. Just my $0.02.