Strange JDBC errors? Possible session management issues - any pointers?

Hi,

I'm a technical analyst with a payment processing company, and have been asked to investigate why an application of ours keeps crashing out daily, due to basically too many open connections into an Oracle database. The app gets a lot of traffic, and is hosted in Jrun. Its written in JSP, which I'm not an expert with but I'm learning quickly! I have some concerns about session management within the code between oracle, and our payment gateway (which has its own API), and was wondering what you think my throw the numerous errors we get below (constantly!)

DaonBean hasMoreTransactionData Exception :java.sql.SQLException: ResultSet.next was not called

DaonBean hasMoreCustomerDetails Exception : java.sql.SQLException: Exhausted Resultset

DaoBean could not close: java.sql.SQLException: This Connection has either timed out or been closed, and it has returned to its pool. You must re-acquire the Connection.

DaoBean locateTransUsingUserID Method Exception : java.sql.SQLException: This Connection has either timed out or been closed, and it has returned to its pool. You must re-acquire the Connection.

DaonBean hasMoreCustomerDetails Exception : java.sql.SQLException: Closed Resultset: next

Related to card payment processing:

java.lang.IllegalStateException: Session is invalid

java.lang.IllegalStateException: Session is invalid

java.lang.IllegalStateException: Session is invalid

java.lang.IllegalStateException: Session is invalid

DaonBean hasMoreCustomerDetails Exception : java.sql.SQLException: Exhausted Resultset

DaoBean could not close: java.sql.SQLException: This Connection has either timed out or been closed, and it has returned to its pool. You must re-acquire the Connection.

Do these type of errors suggest initially a fundamental issue, or does nothing immediately stand out? The code base changes frequently, and since some new payment methods were updated, the application have become very unstable.

Hope you can advise any initial thoughts!

Kind regards,

Scott.

[2105 byte] By [scottinchama] at [2007-11-27 8:32:18]
# 1

To me those errors suggest that you've most probably got a connection (and possibly other resources) shared by multiple threads, which is a Bad Thing.

There are several typical programming mistakes that can cause this to happen. Most probable examples are inappropriate use of a static field in one of the classes, or mutable use of fields (dynamic or static) in servlets or equivalent classes.

dcmintera at 2007-7-12 20:28:06 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 2

Hi dcminter.

Great thanks for the reply, our software vendor believes the problem only exists since we use 'Jrun' to run the payment processing application.

They have suggested we migrate to Apache Tomcat the problems will go away...

Do you think this is wishful thinking? As I understand it, these errors being thrown are due to the code itself, not the environment.

Cheers, scott.

scottinchama at 2007-7-12 20:28:06 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 3

> Do you think this is wishful thinking?

Yes. I'd be very surprised if this was a JRun specific problem. However, since it's probably a race condition that causes the issue, you might find that all sorts of changes will make the symptoms go away - but that's not fixing the bug and I don't recommend it as a solution.

dcmintera at 2007-7-12 20:28:06 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...