× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



I am having a problem with a stored procedure. Hopefully, someone has experience with this. Here is my environment.

- Jakarta Tomcat 4.0.4 running on iSeries.
- Servlet calls a stored procedure to get list of results.
- Stored Procedure is written in RPG, running on same iSeries.

Everything works great when there are not simultanious requests to the same Stored Procedure. If two users request the results at approximately the same time, one of them doesn't get any results. From what I can tell, the second person to request the results get the results, and the first person gets none.

I have verified that the Servlet (as expected) is being executed in two seperate threads. The Connection and the CallableStatement are declared as fields (class level variables). The ResultSet is a local variable that immediately gets turned into an ArrayList which is passed to a JSP page for display. So, I am using the same Connection for every user, and calling the "executeQuery()" method on the same CallableStatement.

Can anyone see what is wrong? My guess is that this connection is being serviced by the same QZDASOINIT prestart job, therefore it is technically the same job that is calling the Stored Procedure each time, and that is why it can't handle multi-threading. Does anyone know how to get around this? Should I create a seperate Connection object for each user? That seems ineffecient.


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.