× 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 have had just this kind of problem recently with stored procedures
returning SQL result sets and the AS/400 ToolBox JDBC Driver (unfortunately
the native AS/400 'DB2' driver does not support this feature at all!).

It seems that while Connection is threadsafe, Statement and ResultSets
(cursors) are not.
See http://www-1.ibm.com/servers/eserver/iseries/toolbox/faqjdbc.htm#faqB4

Thye solution is to use 'synchronized' in all relevant places.

The strange thing is that I believe I did not have this issue when my code
was installed on another AS/400. Unfortunately I do not have access to that
box now, so I am unable to compare OS/400, Toolbox PTF levels.

Hope this helps.

Chris Jewell
mailto:jewellcj@jewellconsult.com


-----Original Message-----
From: java400-l-admin@midrange.com
[mailto:java400-l-admin@midrange.com]On Behalf Of DUCRET Gilles (GVA)
Sent: Wednesday, October 03, 2001 3:16 AM
To: JAVA400-L (E-mail)
Subject: Stored procedure and close connection


This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.
--
[ Picked text/plain from multipart/alternative ]
Hello everybody,

I have had a strange problem on my system and i am wondering what is
happening when, from the browser we clic on
a new link while a stored procedure is being executed.

Let me explain.

We use WAS3.5 on the AS400, and the IBM Data Access Beans (com.ibm.db.*) in
our java code

I have done the following:

Connected to our system through the internet.

Information have been accessed into our database:
        - Get a connection from the pool
        - Call a stored procedure

Since it was long to get a response, i have decided to clic on another link.

what is happening with Websphere? What happens to the thread that was
handling my DB request?
At the end of the method that was called i have a try {} finally to make
sure the connection is always returned.

I have this question, because a colleague of mine get connected at the same
time, and got the result of my query !!!
I have checked all my code, it seems to be ok, completely thread safe. It is
the very first time we have this (since more than 1 year).

So i was wondering if the connection had been released properly or not, and
if the other user could have received my connection.

Is it possible that the connection has been released to the pool and have
been given to the other user, but the stored procedure was still running
(there is no new job with this stored proc). As a result the other user got
my result.

I don't think it hasnot been released because i have this finally in my
code.
I am quite sure that our java code is thread safe (checked and rechecked,
plus ok since more than a year)

Any idea?

Gilles Ducret
Wealth Management Division
IT Architect
Lloyds TSB Bank
Tel: + 41 22 307 31 50
Mob: +41 79 217 21 41



**********************************************************************
This E-mail and any files transmitted with it are confidential
and intended for the exclusive use of the addressee(s) only.
 You should not disclose its contents to any other person.
If you are not the intended recipient please notify the sender
immediately.
**********************************************************************
_______________________________________________
This is the Java Programming on and around the iSeries / AS400 (JAVA400-L)
mailing list
To post a message email: JAVA400-L@midrange.com
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/cgi-bin/listinfo/java400-l
or email: JAVA400-L-request@midrange.com
Before posting, please take a moment to review the archives
at http://archive.midrange.com/java400-l.




As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

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.