DB2 has some query options in so called QAQQINI table.
I've found out that I can make my custom QAQQINI... here is the post.
And I made it in my library. And made the modifications:
-1 means: A value of -1 will force SQL to not reuse ODPs (forces full close
and full open), but this must be set at the start of the session before the
QAQQINI query options are here:
So after that I modified my jdbc connection url (added qaqqinilib property):
AS400 JDBC url properties are here:
After all that the locks are still there after two sql queries. I've tried
changing OPEN_CURSOR_THRESHOLD to 1 and OPEN_CURSOR_CLOSE_COUNT to 1, but
the locks are always there.
Then I tried to add a JDBC propery cursor hold to my JDBC url, setting it to
Nothing worked, am I missing something?
date: Sun, 21 Mar 2010 21:49:16 -0000
from: "Neill Harper" <neill.harper@xxxxxxxx>
subject: RE: Locks are held... never released...
You are right Chuck, the Doc that Davor sent states.
"Some operating system commands and all SQL statements that require an
exclusive lock (DLTF, DROP TABLE, CLRPFM, and so on) will cause a pseudo
closed cursor to be hard closed so that the lock is released"
It kind of feels like to me, someone couldn't be bothered changing all of
the OS commands when pseudo closing was introduced :-)
From: java400-l-bounces@xxxxxxxxxxxx [mailto:java400-l-bounces@xxxxxxxxxxxx]
On Behalf Of CRPence
Sent: 21 March 2010 19:30
Subject: Re: Locks are held... never released...
Neill Harper wrote:
That has helped bring clarity to the situation.
It does raise one question though....
When should you use ALCOBJ CONFLICT(*RQSRLS)?
The same effect as ALCOBJ CONFLICT(*RQSRLS) is part of the
SQL ALTER TABLE request, at the very beginning, so issuing
the ALCOBJ explicitly would be redundant. Most every database
action that requires exclusive use of the TABLE will similarly
effect that request; albeit using a method within the OS database
[SQL] programs rather than via the CL command. There should be no
need to issue that CL request to effect removal of the locks held
to maintain "pseudo closed cursors".
So anyhow... that CL request should not be [inferred to be]
recommended, neither as a corrective nor as a preventive action.
There should be few [if any] operations by the SQL database
against a TABLE that would be impacted by an actual pseudo-closed
cursors; except for example, the impacts noted in the previous
I should have written "Most every database *SQL* action that
requires exclusive use of the TABLE will similarly effect" the
equivalent of CONFLICT(*RQSRLS), similar to my mention of "operation
by the SQL database" in the summary paragraph.
The CL command ALCOBJ would be used mostly for non-SQL operations
that will still conflict in some manner with the pseudo-closed held
locks, but which are operations deemed unworthy for the database to
request the release of those locks to perform that operation, since
the requests are outside of the SQL and thus best not unnecessarily
impact the SQL. Examples might be: RNMOBJ versus SQL RENAME,
ENDJRNPF vs no SQL equivalent, RSTOBJ vs no SQL equivalent, CLRPFM
vs SQL DELETE with no or high cardinality WHERE clause, GRTOBJAUT vs
SQL GRANT etc.. I am unsure if some less critical SQL DDL requests
such as COMMENT ON or LABEL ON might be impacted\prevented by
pseudo-closed held locks, but I suspect that even these do not
require the ALCOBJ. Being an SQL request [versus a non-SQL database
request which is typically CL-invoked], the SQL will attempt to
perform as if there were no such thing as the pseudo-closed held
locks, in order to work just like any other database; i.e. if after
multiple repeated SELECT & close cursor requested in a
thread\process on another database would still allow LABEL ON in any
other thread\process, then so too should the DB2 for i SQL [barring
limitations imposed upon effecting the closes in the other threads
This is the Java Programming on and around the iSeries / AS400 (JAVA400-L)
To post a message email: JAVA400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
or email: JAVA400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
As an Amazon Associate we earn from qualifying purchases.