16 vs 32 bit ODBC problem

teldb2kals

16 vs 32 bit ODBC problem
Hi everybody,

We have got a problem with one of our applications which we have havent been
able to figure out, yet.

This is a 16 bit Windows based application (it is pretty old) connecting to
DB2 (V5) on the mainframe using DB2 Connect V5, with options which kick off
other applications (again 16 bit).

When using 16 bit ODBC driver (all these days), there were no problems.

Pgm1 starts (connects to DB2)
Select Option
Pgm2 starts (connects to DB2, gets data, disconnects)
End of Pgm2
Pgm1 is unaffected. (Tries to get some DB2 data, uses its existing connection,
is succesful)

When using 32 bit ODBC driver,

Pgm1 starts (connects to DB2)
Select Option
Pgm2 starts (connects to DB2, gets data, disconnects)
End of Pgm2
Pgm1 gets error. (Tries to get some DB2 data, error saying connection doesnt
exist)

On checking up using Omegamon on OS/390, we found that, when using 16bit, the
two DB2 connections have their own threads, each pgm's DB2 activity is under
its own thread.

But, using the 32bit ODBC, after pgm2 starts on its own thread, any further
activity in pgm1 uses pgm2's thread instead of pgm1's. So, when pgm2 ends, its
thread also ends, and any further DB2 activity in pgm1 tries to find pgm2's
thread, and fails.

Ooh!!! If any of u out there cd make out what exactly the problem is, can u
provide any hints on what cd be causing it? Is there any difference in the way
16 and 32 bit ODBC drivers handle DB2 threads? We r still investigating the
code (which itself is complex, to say the least), but any help is welcome. We
r using IBM's DB2 ODBC driver.

Thanx.

Cheers,
Kals

---------------------------------
Powered by http://www.telstra.com



Susan Lawson

Re: ODBC problem
(in response to teldb2kals)
Kals,

What program are you using to connect (VB, VA, etc...)? And have you been
able to capture the ODBC error codes?

Regards,

Susan Lawson

www.ylassoc.com

-----Original Message-----
From: DB2 Data Base Discussion List [mailto:[login to unmask email]On Behalf Of
teldb2kals
Sent: Wednesday, December 27, 2000 1:16 AM
To: [login to unmask email]
Subject: ODBC problem


Hi everyone,

Wish u all a merry New Year vacation.

I had posted this sometime back, but without a response. I hope I get one
atleast this time.

We have got a problem with one of our applications which we have havent been
able to figure out, yet.

This is a 16 bit Windows based application (it is pretty old) connecting to
DB2 (V5) on the mainframe using DB2 Connect V5, with options which kick off
other applications (again 16 bit).

When using 16 bit ODBC driver (all these days), there were no problems.

Pgm1 starts (connects to DB2)
Perform action
Pgm2 starts (connects to DB2, gets data, disconnects)
End of Pgm2
Pgm1 is unaffected. (Tries to get some DB2 data, uses its existing
connection,
is succesful)

When using 32 bit ODBC driver,

Pgm1 starts (connects to DB2)
Perform action
Pgm2 starts (connects to DB2, gets data, disconnects)
End of Pgm2
Pgm1 gets error. (Tries to get some DB2 data, error saying connection doesnt
exist)

On checking up using Omegamon on OS/390, we found that, when using 16bit,
the
two DB2 connections have their own threads, each pgm's DB2 activity is under
its own thread.

But, using the 32bit ODBC, after pgm2 starts on its own thread, any further
activity in pgm1 uses pgm2's thread instead of pgm1's. So, when pgm2 ends,
its
thread also ends, and any further DB2 activity in pgm1 tries to find pgm2's
thread, and fails.

Ooh!!! If any of u out there cd make out what exactly the problem is, can u
provide any hints on what cd be causing it? Is there any difference in the
way
16 and 32 bit ODBC drivers handle DB2 threads? We r using IBM's DB2 ODBC
driver.

TIA.

Cheers,
Kals

---------------------------------
Powered by http://www.telstra.com








teldb2kals

ODBC problem
(in response to teldb2kals)
Hi everyone,

Wish u all a merry New Year vacation.

I had posted this sometime back, but without a response. I hope I get one
atleast this time.

We have got a problem with one of our applications which we have havent been
able to figure out, yet.

This is a 16 bit Windows based application (it is pretty old) connecting to
DB2 (V5) on the mainframe using DB2 Connect V5, with options which kick off
other applications (again 16 bit).

When using 16 bit ODBC driver (all these days), there were no problems.

Pgm1 starts (connects to DB2)
Perform action
Pgm2 starts (connects to DB2, gets data, disconnects)
End of Pgm2
Pgm1 is unaffected. (Tries to get some DB2 data, uses its existing connection,
is succesful)

When using 32 bit ODBC driver,

Pgm1 starts (connects to DB2)
Perform action
Pgm2 starts (connects to DB2, gets data, disconnects)
End of Pgm2
Pgm1 gets error. (Tries to get some DB2 data, error saying connection doesnt
exist)

On checking up using Omegamon on OS/390, we found that, when using 16bit, the
two DB2 connections have their own threads, each pgm's DB2 activity is under
its own thread.

But, using the 32bit ODBC, after pgm2 starts on its own thread, any further
activity in pgm1 uses pgm2's thread instead of pgm1's. So, when pgm2 ends, its
thread also ends, and any further DB2 activity in pgm1 tries to find pgm2's
thread, and fails.

Ooh!!! If any of u out there cd make out what exactly the problem is, can u
provide any hints on what cd be causing it? Is there any difference in the way
16 and 32 bit ODBC drivers handle DB2 threads? We r using IBM's DB2 ODBC
driver.

TIA.

Cheers,
Kals

---------------------------------
Powered by http://www.telstra.com



teldb2kals

Re: ODBC problem
(in response to Susan Lawson)
Hi Susan,

We r using VC++. The SQLstate we get when we go back to PGM1 after closing
PGM2 is 08003, which is basically "connection does not exist".

We r still working on the problem, trying to run some traces. One recent
possible clue is the following infm from the CLI Guide and Reference under the
description for SQLSetConnection function


"DB2 CLI allows multiple concurrent connections. This means that it is no
longer clear which connection an embedded SQL routine would use upon being
invoked. In practice, the embedded routine would use the connection associated
with the most recent network activity. However, from the application's
perspective, this is not always deterministic and it is difficult to keep
track of this information. SQLSetConnection() is used to allow the application
to explicitly specify which connection is active"


This might mean that, under the multithreading process in DB2 CLI v5, when
PGM1 tries to issue a SQL statement after PGM2 ends, the CLI might be trying
to use the most recent connection, being PGM2 in this case. Of course, this is
theorising, and we r experimenting with the code.

Looking forward to more inputs from the list.

Cheers,
Kals

-----Original Message-----
From: Susan Lawson [SMTP:[login to unmask email]
Sent: Wednesday, December 27, 2000 8:09 AM
To: [login to unmask email]
Subject: Re: ODBC problem

Kals,

What program are you using to connect (VB, VA, etc...)? And have you been
able to capture the ODBC error codes?

Regards,

Susan Lawson

www.ylassoc.com

-----Original Message-----
From: DB2 Data Base Discussion List [mailto:[login to unmask email]On Behalf Of
teldb2kals
Sent: Wednesday, December 27, 2000 1:16 AM
To: [login to unmask email]
Subject: ODBC problem


Hi everyone,

Wish u all a merry New Year vacation.

I had posted this sometime back, but without a response. I hope I get one
atleast this time.

We have got a problem with one of our applications which we have havent been
able to figure out, yet.

This is a 16 bit Windows based application (it is pretty old) connecting to
DB2 (V5) on the mainframe using DB2 Connect V5, with options which kick off
other applications (again 16 bit).

When using 16 bit ODBC driver (all these days), there were no problems.

Pgm1 starts (connects to DB2)
Perform action
Pgm2 starts (connects to DB2, gets data, disconnects)
End of Pgm2
Pgm1 is unaffected. (Tries to get some DB2 data, uses its existing
connection,
is succesful)

When using 32 bit ODBC driver,

Pgm1 starts (connects to DB2)
Perform action
Pgm2 starts (connects to DB2, gets data, disconnects)
End of Pgm2
Pgm1 gets error. (Tries to get some DB2 data, error saying connection doesnt
exist)

On checking up using Omegamon on OS/390, we found that, when using 16bit,
the
two DB2 connections have their own threads, each pgm's DB2 activity is under
its own thread.

But, using the 32bit ODBC, after pgm2 starts on its own thread, any further
activity in pgm1 uses pgm2's thread instead of pgm1's. So, when pgm2 ends,
its
thread also ends, and any further DB2 activity in pgm1 tries to find pgm2's
thread, and fails.

Ooh!!! If any of u out there cd make out what exactly the problem is, can u
provide any hints on what cd be causing it? Is there any difference in the
way
16 and 32 bit ODBC drivers handle DB2 threads? We r using IBM's DB2 ODBC
driver.

TIA.

Cheers,
Kals

---------------------------------
Powered by http://www.telstra.com