This topic is READ ONLY
import-bot (20211) [Avatar] Offline
#1
[Originally posted by cwong]

My application is up and running great. I have a separate application server
machine and web server machine. I leave the application running all day and
night. My problem is that each morning the application fails because it cannot
connect to the db2 database. I do know that the ODBC connection is dropped
every night when the tables are closed but then it is re-established every
morning. All I have to do is shut down the application server and start it
back up again then everything works fine. How can I avoid doing this every
morning? I was having this problem before and after using transaction
pooling.

thanks,
Catherine Wong
import-bot (20211) [Avatar] Offline
#2
Re: Losing ODBC database connection
[Originally posted by ezad1]

I would understand having this problem with trans pooling on but with it off,
you'd actually be reconnecting with every call. When you say the application
fails, do you mean that the dist function is failing do to a SQLCode<>0 after
a connect; statement? If so, where are you getting the cransaction object?
SQLCA? Are you creating it? If not, try that.
import-bot (20211) [Avatar] Offline
#3
Re: Losing ODBC database connection
[Originally posted by cwong]

I am using SQLCA for the transaction object. The dist function does return a
SQLCode <> 0 but it should return a row from the table. I am doing a retrieve
on valid data that is in the db2 table. Yet nothing is returned from the
retrieve.
As soon as I close the application and restart it, everything works fine.

Catherine Wong

> I would understand having this problem with trans pooling on but with it off,
> you'd actually be reconnecting with every call. When you say the application
> fails, do you mean that the dist function is failing do to a SQLCode<>0 after
> a connect; statement? If so, where are you getting the cransaction object?
> SQLCA? Are you creating it? If not, try that.
import-bot (20211) [Avatar] Offline
#4
Re: Losing ODBC database connection
[Originally posted by ezad1]

So the script of the df has something like this?

connect;
if SQLCA.SQLCode = 0 then
// set up a datastore
ll = ds.retrieve()
// now ll should = 1 but it doesn't and SQLCode = 0?
end if


> I am using SQLCA for the transaction object. The dist function does return a
> SQLCode <> 0 but it should return a row from the table. I am doing a retrieve
> on valid data that is in the db2 table. Yet nothing is returned from the
> retrieve.
> As soon as I close the application and restart it, everything works fine.
>
> Catherine Wong
>
> > I would understand having this problem with trans pooling on but with it
off,
> > you'd actually be reconnecting with every call. When you say the application
> > fails, do you mean that the dist function is failing do to a SQLCode<>0
after
> > a connect; statement? If so, where are you getting the cransaction object?
> > SQLCA? Are you creating it? If not, try that.