473,398 Members | 2,335 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

SQLCODE: -805 on V8.1 fp 10

Hi,
I'm getting SQLCODE: -805, SQLSTATE: 51002, SQLERRMC:
NULLID.SYSLH203. I've seen this problem posted before and I thought
it might be a statement handle leak. I'm using a pooled datasource,
then I issue sql statements. I've cleaned up all my sql calls
ensuring there is prepared statement close and result set close for
each one, but it didn't change the problem. I added a commit for
good measure, but that didn't help either. As suggested by another
post, I added 20 packages and upped my applheapsize=16384 and
maxappls=50, but that only delayed the problem for a couple hours.

I've taken health snapshots to get a sense of whats going on. The
memory stats look fine. here's some other stats from the snapshot:

Commit statements attempted = 15779
Rollback statements attempted = 41
Dynamic statements attempted = 62819
Static statements attempted = 15826
Failed statement operations = 139
Select SQL statements executed = 13464
Update/Insert/Delete statements executed = 11787
DDL statements executed = 11
Inactive stmt history memory usage (bytes) = 0

Internal automatic rebinds = 0
Internal rows deleted = 0
Internal rows inserted = 0
Internal rows updated = 0
Internal commits = 37
Internal rollbacks = 0
Internal rollbacks due to deadlock = 0

Rows deleted = 0
Rows inserted = 8904
Rows updated = 3595
Rows selected = 11452
Rows read = 2696559
Binds/precompiles attempted = 0

Number of SQL requests since last commit = 95
Commit statements = 15480
Rollback statements = 0
Dynamic SQL statements attempted = 60820
Static SQL statements attempted = 15480
Failed statement operations = 109
Select SQL statements executed = 13022
Update/Insert/Delete statements executed = 11478

I am running DB2 v8.1.0.96", "s050811", "MI00138", and FixPak "10".

Does anyone know what might be going on, or how to debug this
problem? Everything I tried doesn't seem to make a difference.
Thanks,
Louise

Feb 23 '07 #1
7 2688
ls********@yahoo.com wrote:
Hi,
I'm getting SQLCODE: -805, SQLSTATE: 51002, SQLERRMC:
NULLID.SYSLH203. I've seen this problem posted before and I thought
it might be a statement handle leak. I'm using a pooled datasource,
then I issue sql statements. I've cleaned up all my sql calls
ensuring there is prepared statement close and result set close for
each one, but it didn't change the problem. I added a commit for
good measure, but that didn't help either. As suggested by another
post, I added 20 packages and upped my applheapsize=16384 and
maxappls=50, but that only delayed the problem for a couple hours.

I've taken health snapshots to get a sense of whats going on. The
memory stats look fine. here's some other stats from the snapshot:

Commit statements attempted = 15779
Rollback statements attempted = 41
Dynamic statements attempted = 62819
Static statements attempted = 15826
Failed statement operations = 139
Select SQL statements executed = 13464
Update/Insert/Delete statements executed = 11787
DDL statements executed = 11
Inactive stmt history memory usage (bytes) = 0

Internal automatic rebinds = 0
Internal rows deleted = 0
Internal rows inserted = 0
Internal rows updated = 0
Internal commits = 37
Internal rollbacks = 0
Internal rollbacks due to deadlock = 0

Rows deleted = 0
Rows inserted = 8904
Rows updated = 3595
Rows selected = 11452
Rows read = 2696559
Binds/precompiles attempted = 0

Number of SQL requests since last commit = 95
Commit statements = 15480
Rollback statements = 0
Dynamic SQL statements attempted = 60820
Static SQL statements attempted = 15480
Failed statement operations = 109
Select SQL statements executed = 13022
Update/Insert/Delete statements executed = 11478

I am running DB2 v8.1.0.96", "s050811", "MI00138", and FixPak "10".

Does anyone know what might be going on, or how to debug this
problem? Everything I tried doesn't seem to make a difference.
Do you properly return your connections to the connection pool?
DB2PooledConnection has a specific method for that. Don't rely on Java's
garbage collector for something like that.

Besides that, you may want to take a JDBC trace to figure out which handle
receives the -805. Then have a look at the number of the handles. If they
are constantly growing, you still have a leak somewhere.

--
Knut Stolze
DB2 z/OS Utilities Development
IBM Germany
Feb 23 '07 #2
On Feb 23, 3:07 am, Knut Stolze <sto...@de.ibm.comwrote:
lsaidna...@yahoo.com wrote:
Hi,
I'm getting SQLCODE: -805, SQLSTATE: 51002, SQLERRMC:
NULLID.SYSLH203. I've seen this problem posted before and I thought
it might be a statement handle leak. I'm using a pooled datasource,
then I issue sql statements. I've cleaned up all my sql calls
ensuring there is prepared statement close and result set close for
each one, but it didn't change the problem. I added a commit for
good measure, but that didn't help either. As suggested by another
post, I added 20 packages and upped my applheapsize=16384 and
maxappls=50, but that only delayed the problem for a couple hours.
I've taken health snapshots to get a sense of whats going on. The
memory stats look fine. here's some other stats from the snapshot:
Commit statements attempted = 15779
Rollback statements attempted = 41
Dynamic statements attempted = 62819
Static statements attempted = 15826
Failed statement operations = 139
Select SQL statements executed = 13464
Update/Insert/Delete statements executed = 11787
DDL statements executed = 11
Inactive stmt history memory usage (bytes) = 0
Internal automatic rebinds = 0
Internal rows deleted = 0
Internal rows inserted = 0
Internal rows updated = 0
Internal commits = 37
Internal rollbacks = 0
Internal rollbacks due to deadlock = 0
Rows deleted = 0
Rows inserted = 8904
Rows updated = 3595
Rows selected = 11452
Rows read = 2696559
Binds/precompiles attempted = 0
Number of SQL requests since last commit = 95
Commit statements = 15480
Rollback statements = 0
Dynamic SQL statements attempted = 60820
Static SQL statements attempted = 15480
Failed statement operations = 109
Select SQL statements executed = 13022
Update/Insert/Delete statements executed = 11478
I am running DB2 v8.1.0.96", "s050811", "MI00138", and FixPak "10".
Does anyone know what might be going on, or how to debug this
problem? Everything I tried doesn't seem to make a difference.

Do you properly return your connections to the connection pool?
DB2PooledConnection has a specific method for that. Don't rely on Java's
garbage collector for something like that.

Besides that, you may want to take a JDBC trace to figure out which handle
receives the -805. Then have a look at the number of the handles. If they
are constantly growing, you still have a leak somewhere.

--
Knut Stolze
DB2 z/OS Utilities Development
IBM Germany- Hide quoted text -

- Show quoted text -
Thanks for the quick reply. I am not returning the connection, so
that may be my problem. However I am using
DB2ConnectionPoolDataSource(), not DB2PooledConnection() to establish
my connection. I see the connectionReuseProtocol and
statementReuseProtocol properties in DB2ConnectionPoolDataSource.
Can these be used to return the connection? Are you suggesting
that I switch to DB2PooledConnection and use recycleConnection or
resetPhysicalConnection instead?

Feb 23 '07 #3
ls********@yahoo.com wrote:
On Feb 23, 3:07 am, Knut Stolze <sto...@de.ibm.comwrote:
>lsaidna...@yahoo.com wrote:
Hi,
I'm getting SQLCODE: -805, SQLSTATE: 51002, SQLERRMC:
NULLID.SYSLH203. I've seen this problem posted before and I thought
it might be a statement handle leak. I'm using a pooled datasource,
then I issue sql statements. I've cleaned up all my sql calls
ensuring there is prepared statement close and result set close for
each one, but it didn't change the problem. I added a commit for
good measure, but that didn't help either. As suggested by another
post, I added 20 packages and upped my applheapsize=16384 and
maxappls=50, but that only delayed the problem for a couple hours.
Adding packages is usually not a fix for the problem; it just delays it. If
you are lucky, the delay is big enough to hide the problem. But as you
noticed, that's not reliable at all.
I've taken health snapshots to get a sense of whats going on. The
memory stats look fine. here's some other stats from the snapshot:
Commit statements attempted = 15779
Rollback statements attempted = 41
Dynamic statements attempted = 62819
Static statements attempted = 15826
Failed statement operations = 139
Select SQL statements executed = 13464
Update/Insert/Delete statements executed = 11787
DDL statements executed = 11
Inactive stmt history memory usage (bytes) = 0
Internal automatic rebinds = 0
Internal rows deleted = 0
Internal rows inserted = 0
Internal rows updated = 0
Internal commits = 37
Internal rollbacks = 0
Internal rollbacks due to deadlock = 0
Rows deleted = 0
Rows inserted = 8904
Rows updated = 3595
Rows selected = 11452
Rows read = 2696559
Binds/precompiles attempted = 0
Number of SQL requests since last commit = 95
Commit statements = 15480
Rollback statements = 0
Dynamic SQL statements attempted = 60820
Static SQL statements attempted = 15480
Failed statement operations = 109
Select SQL statements executed = 13022
Update/Insert/Delete statements executed = 11478
I am running DB2 v8.1.0.96", "s050811", "MI00138", and FixPak "10".
Does anyone know what might be going on, or how to debug this
problem? Everything I tried doesn't seem to make a difference.

Do you properly return your connections to the connection pool?
DB2PooledConnection has a specific method for that. Don't rely on Java's
garbage collector for something like that.

Besides that, you may want to take a JDBC trace to figure out which
handle
receives the -805. Then have a look at the number of the handles. If
they are constantly growing, you still have a leak somewhere.

Thanks for the quick reply. I am not returning the connection, so
that may be my problem. However I am using
DB2ConnectionPoolDataSource(), not DB2PooledConnection() to establish
my connection. I see the connectionReuseProtocol and
statementReuseProtocol properties in DB2ConnectionPoolDataSource.
Can these be used to return the connection?
Have a look here:

http://java.sun.com/j2se/1.4.2/docs/...onnection.html

You have to close a PooledConnection so that it is returned to the pool
properly.

However, I have my doubts that the handling of Connection or
PooledConnection objects causes this problem. Statements use packages -
not connections. What happens if you don't use connection pooling?

What have you found in the JDBC trace?
Are you suggesting
that I switch to DB2PooledConnection and use recycleConnection or
resetPhysicalConnection instead?
No, I'm not suggestion that. Besides, you shouldn't fiddle with the
physical connection at all if you're using connection pooling. (The Java
docs are quite clear on that.)

--
Knut Stolze
DB2 z/OS Utilities Development
IBM Germany
Feb 23 '07 #4
On Feb 23, 10:37 am, Knut Stolze <sto...@de.ibm.comwrote:
lsaidna...@yahoo.com wrote:
On Feb 23, 3:07 am, Knut Stolze <sto...@de.ibm.comwrote:
lsaidna...@yahoo.com wrote:
Hi,
I'm getting SQLCODE: -805, SQLSTATE: 51002, SQLERRMC:
NULLID.SYSLH203. I've seen this problem posted before and I thought
it might be a statement handle leak. I'm using a pooled datasource,
then I issue sql statements. I've cleaned up all my sql calls
ensuring there is prepared statement close and result set close for
each one, but it didn't change the problem. I added a commit for
good measure, but that didn't help either. As suggested by another
post, I added 20 packages and upped my applheapsize=16384 and
maxappls=50, but that only delayed the problem for a couple hours.

Adding packages is usually not a fix for the problem; it just delays it. If
you are lucky, the delay is big enough to hide the problem. But as you
noticed, that's not reliable at all.


I've taken health snapshots to get a sense of whats going on. The
memory stats look fine. here's some other stats from the snapshot:
Commit statements attempted = 15779
Rollback statements attempted = 41
Dynamic statements attempted = 62819
Static statements attempted = 15826
Failed statement operations = 139
Select SQL statements executed = 13464
Update/Insert/Delete statements executed = 11787
DDL statements executed = 11
Inactive stmt history memory usage (bytes) = 0
Internal automatic rebinds = 0
Internal rows deleted = 0
Internal rows inserted = 0
Internal rows updated = 0
Internal commits = 37
Internal rollbacks = 0
Internal rollbacks due to deadlock = 0
Rows deleted = 0
Rows inserted = 8904
Rows updated = 3595
Rows selected = 11452
Rows read = 2696559
Binds/precompiles attempted = 0
Number of SQL requests since last commit = 95
Commit statements = 15480
Rollback statements = 0
Dynamic SQL statements attempted = 60820
Static SQL statements attempted = 15480
Failed statement operations = 109
Select SQL statements executed = 13022
Update/Insert/Delete statements executed = 11478
I am running DB2 v8.1.0.96", "s050811", "MI00138", and FixPak "10".
Does anyone know what might be going on, or how to debug this
problem? Everything I tried doesn't seem to make a difference.
Do you properly return your connections to the connection pool?
DB2PooledConnection has a specific method for that. Don't rely on Java's
garbage collector for something like that.
Besides that, you may want to take a JDBC trace to figure out which
handle
receives the -805. Then have a look at the number of the handles. If
they are constantly growing, you still have a leak somewhere.
Thanks for the quick reply. I am not returning the connection, so
that may be my problem. However I am using
DB2ConnectionPoolDataSource(), not DB2PooledConnection() to establish
my connection. I see the connectionReuseProtocol and
statementReuseProtocol properties in DB2ConnectionPoolDataSource.
Can these be used to return the connection?

Have a look here:

http://java.sun.com/j2se/1.4.2/docs/...onnection.html

You have to close a PooledConnection so that it is returned to the pool
properly.

However, I have my doubts that the handling of Connection or
PooledConnection objects causes this problem. Statements use packages -
not connections. What happens if you don't use connection pooling?

What have you found in the JDBC trace?
Are you suggesting
that I switch to DB2PooledConnection and use recycleConnection or
resetPhysicalConnection instead?

No, I'm not suggestion that. Besides, you shouldn't fiddle with the
physical connection at all if you're using connection pooling. (The Java
docs are quite clear on that.)

--
Knut Stolze
DB2 z/OS Utilities Development
IBM Germany- Hide quoted text -

- Show quoted text -
Only one connection is established and all the sql statements are
executed using this connection. (I'm not sure why connection pooling
was used as I am not the original author.) I can look into changing
it to DriverManager, and I will also set up a JDBC trace. I haven't
set up a trace before, so it will take a little while for me to get it
working. I'll let you know what I find.

Feb 23 '07 #5
Are there special requirements for JDBCTrace? This looks very
simple, so I am not sure why I am having problems. I set up the
db2cli.ini file as documented in the IBM manuals. The /home/db2inst1/
trace dir has perm 777 and there is a blank line at the end of the
db2cli.in file. db2 get cli cfg for section common shows these
settings:
Section: common
-------------------------------------------------
jdbctrace=1
JdbcTracePathName=/home/db2inst1/trace
JDBCTraceFlush=1

I stop and start db2, (db2stop, db2start) and then start my
application, but trace files do not appear in the directory. I have
searched my system from / down, and there are no *.trc files on it.

My test env is DB2 PE on Red Hat. I am using db2 = new
DB2ConnectionPoolDataSource(); to establish the connection, and I
tried manually setting the jdbc driver to 2, db2.setDriverType(2); ,
to ensure that the correct driver is being used.
Louise

ls********@yahoo.com wrote:
On Feb 23, 10:37 am, Knut Stolze <sto...@de.ibm.comwrote:
lsaidna...@yahoo.com wrote:
On Feb 23, 3:07 am, Knut Stolze <sto...@de.ibm.comwrote:
>lsaidna...@yahoo.com wrote:
Hi,
I'm getting SQLCODE: -805, SQLSTATE: 51002, SQLERRMC:
NULLID.SYSLH203. I've seen this problem posted before and I thought
it might be a statement handle leak. I'm using a pooled datasource,
then I issue sql statements. I've cleaned up all my sql calls
ensuring there is prepared statement close and result set close for
each one, but it didn't change the problem. I added a commit for
good measure, but that didn't help either. As suggested by another
post, I added 20 packages and upped my applheapsize=16384 and
maxappls=50, but that only delayed the problem for a couple hours.
Adding packages is usually not a fix for the problem; it just delays it. If
you are lucky, the delay is big enough to hide the problem. But as you
noticed, that's not reliable at all.


I've taken health snapshots to get a sense of whats going on. The
memory stats look fine. here's some other stats from the snapshot:
Commit statements attempted = 15779
Rollback statements attempted = 41
Dynamic statements attempted = 62819
Static statements attempted = 15826
Failed statement operations = 139
Select SQL statements executed = 13464
Update/Insert/Delete statements executed = 11787
DDL statements executed = 11
Inactive stmt history memory usage (bytes) = 0
Internal automatic rebinds = 0
Internal rows deleted = 0
Internal rows inserted = 0
Internal rows updated = 0
Internal commits = 37
Internal rollbacks = 0
Internal rollbacks due to deadlock = 0
Rows deleted = 0
Rows inserted = 8904
Rows updated = 3595
Rows selected = 11452
Rows read = 2696559
Binds/precompiles attempted = 0
Number of SQL requests since last commit = 95
Commit statements = 15480
Rollback statements = 0
Dynamic SQL statements attempted = 60820
Static SQL statements attempted = 15480
Failed statement operations = 109
Select SQL statements executed = 13022
Update/Insert/Delete statements executed = 11478
I am running DB2 v8.1.0.96", "s050811", "MI00138", and FixPak "10".
Does anyone know what might be going on, or how to debug this
problem? Everything I tried doesn't seem to make a difference.
>Do you properly return your connections to the connection pool?
>DB2PooledConnection has a specific method for that. Don't rely on Java's
>garbage collector for something like that.
>Besides that, you may want to take a JDBC trace to figure out which
>handle
>receives the -805. Then have a look at the number of the handles. If
>they are constantly growing, you still have a leak somewhere.
Thanks for the quick reply. I am not returning the connection, so
that may be my problem. However I am using
DB2ConnectionPoolDataSource(), not DB2PooledConnection() to establish
my connection. I see the connectionReuseProtocol and
statementReuseProtocol properties in DB2ConnectionPoolDataSource.
Can these be used to return the connection?
Have a look here:

http://java.sun.com/j2se/1.4.2/docs/...onnection.html

You have to close a PooledConnection so that it is returned to the pool
properly.

However, I have my doubts that the handling of Connection or
PooledConnection objects causes this problem. Statements use packages -
not connections. What happens if you don't use connection pooling?

What have you found in the JDBC trace?
Are you suggesting
that I switch to DB2PooledConnection and use recycleConnection or
resetPhysicalConnection instead?
No, I'm not suggestion that. Besides, you shouldn't fiddle with the
physical connection at all if you're using connection pooling. (The Java
docs are quite clear on that.)

--
Knut Stolze
DB2 z/OS Utilities Development
IBM Germany- Hide quoted text -

- Show quoted text -

Only one connection is established and all the sql statements are
executed using this connection. (I'm not sure why connection pooling
was used as I am not the original author.) I can look into changing
it to DriverManager, and I will also set up a JDBC trace. I haven't
set up a trace before, so it will take a little while for me to get it
working. I'll let you know what I find.
Feb 24 '07 #6
On Feb 24, 12:48 pm, lsaidna...@yahoo.com wrote:
Are there special requirements for JDBCTrace? This looks very
simple, so I am not sure why I am having problems. I set up the
db2cli.ini file as documented in the IBM manuals. The /home/db2inst1/
trace dir has perm 777 and there is a blank line at the end of the
db2cli.in file. db2 get cli cfg for section common shows these
settings:
Section: common
-------------------------------------------------
jdbctrace=1
JdbcTracePathName=/home/db2inst1/trace
JDBCTraceFlush=1

I stop and start db2, (db2stop, db2start) and then start my
application, but trace files do not appear in the directory. I have
searched my system from / down, and there are no *.trc files on it.

My test env is DB2 PE on Red Hat. I am using db2 = new
DB2ConnectionPoolDataSource(); to establish the connection, and I
tried manually setting the jdbc driver to 2, db2.setDriverType(2); ,
to ensure that the correct driver is being used.
Louise

lsaidna...@yahoo.com wrote:
On Feb 23, 10:37 am, Knut Stolze <sto...@de.ibm.comwrote:
lsaidna...@yahoo.com wrote:
On Feb 23, 3:07 am, Knut Stolze <sto...@de.ibm.comwrote:
lsaidna...@yahoo.com wrote:
Hi,
I'm getting SQLCODE: -805, SQLSTATE: 51002, SQLERRMC:
NULLID.SYSLH203. I've seen this problem posted before and I thought
it might be a statement handle leak. I'm using a pooled datasource,
then I issue sql statements. I've cleaned up all my sql calls
ensuring there is prepared statement close and result set close for
each one, but it didn't change the problem. I added a commit for
good measure, but that didn't help either. As suggested by another
post, I added 20 packages and upped my applheapsize=16384 and
maxappls=50, but that only delayed the problem for a couple hours.
Adding packages is usually not a fix for the problem; it just delays it. If
you are lucky, the delay is big enough to hide the problem. But as you
noticed, that's not reliable at all.
I've taken health snapshots to get a sense of whats going on. The
memory stats look fine. here's some other stats from the snapshot:
Commit statements attempted = 15779
Rollback statements attempted = 41
Dynamic statements attempted = 62819
Static statements attempted = 15826
Failed statement operations = 139
Select SQL statements executed = 13464
Update/Insert/Delete statements executed = 11787
DDL statements executed = 11
Inactive stmt history memory usage (bytes) = 0
Internal automatic rebinds = 0
Internal rows deleted = 0
Internal rows inserted = 0
Internal rows updated = 0
Internal commits = 37
Internal rollbacks = 0
Internal rollbacks due to deadlock = 0
Rows deleted = 0
Rows inserted = 8904
Rows updated = 3595
Rows selected = 11452
Rows read = 2696559
Binds/precompiles attempted = 0
Number of SQL requests since last commit = 95
Commit statements = 15480
Rollback statements = 0
Dynamic SQL statements attempted = 60820
Static SQL statements attempted = 15480
Failed statement operations = 109
Select SQL statements executed = 13022
Update/Insert/Delete statements executed = 11478
I am running DB2 v8.1.0.96", "s050811", "MI00138", and FixPak "10".
Does anyone know what might be going on, or how to debug this
problem? Everything I tried doesn't seem to make a difference.
Do you properly return your connections to the connection pool?
DB2PooledConnection has a specific method for that. Don't rely on Java's
garbage collector for something like that.
Besides that, you may want to take a JDBC trace to figure out which
handle
receives the -805. Then have a look at the number of the handles. If
they are constantly growing, you still have a leak somewhere.
Thanks for the quick reply. I am not returning the connection, so
that may be my problem. However I am using
DB2ConnectionPoolDataSource(), not DB2PooledConnection() to establish
my connection. I see the connectionReuseProtocol and
statementReuseProtocol properties in DB2ConnectionPoolDataSource.
Can these be used to return the connection?
Have a look here:
>http://java.sun.com/j2se/1.4.2/docs/...onnection.html
You have to close a PooledConnection so that it is returned to the pool
properly.
However, I have my doubts that the handling of Connection or
PooledConnection objects causes this problem. Statements use packages -
not connections. What happens if you don't use connection pooling?
What have you found in the JDBC trace?
Are you suggesting
that I switch to DB2PooledConnection and use recycleConnection or
resetPhysicalConnection instead?
No, I'm not suggestion that. Besides, you shouldn't fiddle with the
physical connection at all if you're using connection pooling. (The Java
docs are quite clear on that.)
--
Knut Stolze
DB2 z/OS Utilities Development
IBM Germany- Hide quoted text -
- Show quoted text -
Only one connection is established and all the sql statements are
executed using this connection. (I'm not sure why connection pooling
was used as I am not the original author.) I can look into changing
it to DriverManager, and I will also set up a JDBC trace. I haven't
set up a trace before, so it will take a little while for me to get it
working. I'll let you know what I find.- Hide quoted text -

- Show quoted text -
I upgraded to fixpak 14, and turned on the trace. The trace is
quite large since this happens after 15000 sql calls. It also does
not happen after the same sql call. Is there something in the trace
that I should be looking for?

Mar 16 '07 #7
On Mar 16, 8:33 am, lsaidna...@yahoo.com wrote:
On Feb 24, 12:48 pm, lsaidna...@yahoo.com wrote:


Are there special requirements for JDBCTrace? This looks very
simple, so I am not sure why I am having problems. I set up the
db2cli.ini file as documented in the IBM manuals. The /home/db2inst1/
trace dir has perm 777 and there is a blank line at the end of the
db2cli.in file. db2 get cli cfg for section common shows these
settings:
Section: common
-------------------------------------------------
jdbctrace=1
JdbcTracePathName=/home/db2inst1/trace
JDBCTraceFlush=1
I stop and start db2, (db2stop, db2start) and then start my
application, but trace files do not appear in the directory. I have
searched my system from / down, and there are no *.trc files on it.
My test env is DB2 PE on Red Hat. I am using db2 = new
DB2ConnectionPoolDataSource(); to establish the connection, and I
tried manually setting the jdbc driver to 2, db2.setDriverType(2); ,
to ensure that the correct driver is being used.
Louise
lsaidna...@yahoo.com wrote:
On Feb 23, 10:37 am, Knut Stolze <sto...@de.ibm.comwrote:
lsaidna...@yahoo.com wrote:
On Feb 23, 3:07 am, Knut Stolze <sto...@de.ibm.comwrote:
>lsaidna...@yahoo.com wrote:
Hi,
I'm getting SQLCODE: -805, SQLSTATE: 51002, SQLERRMC:
NULLID.SYSLH203. I've seen this problem posted before and I thought
it might be a statement handle leak. I'm using a pooled datasource,
then I issue sql statements. I've cleaned up all my sql calls
ensuring there is prepared statement close and result set close for
each one, but it didn't change the problem. I added a commit for
good measure, but that didn't help either. As suggested by another
post, I added 20 packages and upped my applheapsize=16384 and
maxappls=50, but that only delayed the problem for a couple hours.
Adding packages is usually not a fix for the problem; it just delays it. If
you are lucky, the delay is big enough to hide the problem. But as you
noticed, that's not reliable at all.
I've taken health snapshots to get a sense of whats going on. The
memory stats look fine. here's some other stats from the snapshot:
Commit statements attempted = 15779
Rollback statements attempted = 41
Dynamic statements attempted = 62819
Static statements attempted = 15826
Failed statement operations = 139
Select SQL statements executed = 13464
Update/Insert/Delete statements executed = 11787
DDL statements executed = 11
Inactive stmt history memory usage (bytes) = 0
Internal automatic rebinds = 0
Internal rows deleted = 0
Internal rows inserted = 0
Internal rows updated = 0
Internal commits = 37
Internal rollbacks = 0
Internal rollbacks due to deadlock = 0
Rows deleted = 0
Rows inserted = 8904
Rows updated = 3595
Rows selected = 11452
Rows read = 2696559
Binds/precompiles attempted = 0
Number of SQL requests since last commit = 95
Commit statements = 15480
Rollback statements = 0
Dynamic SQL statements attempted = 60820
Static SQL statements attempted = 15480
Failed statement operations = 109
Select SQL statements executed = 13022
Update/Insert/Delete statements executed = 11478
I am running DB2 v8.1.0.96", "s050811", "MI00138", and FixPak "10".
Does anyone know what might be going on, or how to debug this
problem? Everything I tried doesn't seem to make a difference.
>Do you properly return your connections to the connection pool?
>DB2PooledConnection has a specific method for that. Don't rely on Java's
>garbage collector for something like that.
>Besides that, you may want to take a JDBC trace to figure out which
>handle
>receives the -805. Then have a look at the number of the handles. If
>they are constantly growing, you still have a leak somewhere.
Thanks for the quick reply. I am not returning the connection, so
that may be my problem. However I am using
DB2ConnectionPoolDataSource(), not DB2PooledConnection() to establish
my connection. I see the connectionReuseProtocol and
statementReuseProtocol properties in DB2ConnectionPoolDataSource.
Can these be used to return the connection?
Have a look here:
http://java.sun.com/j2se/1.4.2/docs/...onnection.html
You have to close a PooledConnection so that it is returned to the pool
properly.
However, I have my doubts that the handling of Connection or
PooledConnection objects causes this problem. Statements use packages -
not connections. What happens if you don't use connection pooling?
What have you found in the JDBC trace?
Are you suggesting
that I switch to DB2PooledConnection and use recycleConnection or
resetPhysicalConnection instead?
No, I'm not suggestion that. Besides, you shouldn't fiddle with the
physical connection at all if you're using connection pooling. (The Java
docs are quite clear on that.)
--
Knut Stolze
DB2 z/OS Utilities Development
IBM Germany- Hide quoted text -
- Show quoted text -
Only one connection is established and all the sql statements are
executed using this connection. (I'm not sure why connection pooling
was used as I am not the original author.) I can look into changing
it to DriverManager, and I will also set up a JDBC trace. I haven't
set up a trace before, so it will take a little while for me to get it
working. I'll let you know what I find.- Hide quoted text -
- Show quoted text -

I upgraded to fixpak 14, and turned on the trace. The trace is
quite large since this happens after 15000 sql calls. It also does
not happen after the same sql call. Is there something in the trace
that I should be looking for?- Hide quoted text -

- Show quoted text -
found it. It appears that db2 does not handle the dal.sql
staement. My original code looked like this
// add a record
Dal dal = new Dal(sql statement 1);
dal.getPrepared().execute();

// fetch the idx for the precise record we just added
dal.sql(sql statement 2);
ResultSet rs = dal.getPrepared().executeQuery();
if (rs.next()) {
refid = rs.getInt("idx");
}
rs.close();
dal.close();

Needed to be changed to
// add a record
Dal dal = new Dal(sql statement 1);
dal.getPrepared().execute();
dal.close();
// fetch the idx for the precise record we just added
Dal dal2 = new Dal(sql statement 2);
ResultSet rs = dal2.getPrepared().executeQuery();
if (rs.next()) {
refid = rs.getInt("idx");
}
rs.close();
dal2.close();

I'm pretty confident that the dal.sql statement caused the problem
because I inadvertantly left it in the code when I first made my
change, i.e.
Dal dal2 = new Dal(sql statement 2);
dal2.sql(sql statement 2);
and I still had the problem.

Mar 20 '07 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Tborn2b | last post by:
DB2 V 7, Z/OS: I receive an SQLCODE -104 for the following trigger : CREATE TRIGGER TRSERED1 NO CASCADE BEFORE INSERT ON SEMINAR REFERENCING NEW AS ZUGANG
5
by: Jean-Marc Blaise | last post by:
Dear all, Could you explain why some SQL messages do not possess a SQLSTATE ? Why not transmitting the SQLSTATE of the original <sqlcode>, for example if you get a -911 on a RUNSTATS ? ...
3
by: JDPope | last post by:
I have a situation which I cannot get a good lead on how to resolve. One of the applications I support uses the Hibernate software to generate SQL. The app is JAVA with JDBC. In testing the users...
15
by: Twan Kennis | last post by:
Hi, I have a DB2 database on the IBM iSeries platform, on which I created several Stored Procedures with the SQLCODE as a return-parameter. These Stored Procedures are called from a Windows...
2
by: Richard | last post by:
Our web programmer was looking in his application log an found the following error: 2006-08-31 16:33:35,129 ERROR org.hibernate.util.JDBCExceptionReporter - < SQL0723N An error occurred in a...
10
by: scoonie999 | last post by:
I'm having a problem that I can't seem to find any solution for online. I'm using a cursor in a cobol program to fetch some data. I know for a fact that the select should return 2 rows. The...
22
by: Sri | last post by:
All Recenetly our shop migrated to DB2 V8 from V7. We are in IBM System Level: z/OS 1.6.1 @ RSU 0702. Processor : IBM 2064-1C7 (z/900) # 1B89 Mode: 64-bit One of my application is facing...
7
by: Gregor =?UTF-8?B?S292YcSN?= | last post by:
Hi! I was searching through DB2 InfoCenter, but didn't find an answer to my question: When I get an SQLCODE from an SQL command (ADMIN_CMD for example) when I want to know what this code means;...
2
by: APP1MVF | last post by:
Question: I come from a COBOL/DB2 environment so I am use to being able to display the current SQLSTATE or SQLCODE following the issuing of a DB2 command, now I have move over to a LINUX/DB2 shell...
3
by: lenygold via DBMonster.com | last post by:
Thank you very much SERGE for your help. I found example in Graeme Birchall COOKBOOK wich i think exactly what i need for SQL check in triggers: • User query joins to table function - sends...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.