Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

Reconnect DB

2 posts in Objects Last posting was on 2003-06-04 15:34:29.0Z
Goya Posted on 2003-05-25 09:20:53.0Z
Newsgroups: sybase.public.powerbuilder.objects
From: Goya
Date: Sun, 25 May 2003 05:20:53 -0400
Subject: Reconnect DB
Lines: 26
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Message-ID: <364_2862390C5733CCFA003359B585256D31.003359D885256D31@webforums>
Path: forums-1-dub!forums-1-dub!forums-master.sybase.com!webforums.sybase.com!news
Xref: forums-1-dub sybase.public.powerbuilder.objects:7419
Article PK: 734708

In my application, a global connection (gtrx_connection) is used to connect
the a SYBASE server for operations.

To resolve the SYBASE server reboot issue, the following logic has been
built in my front-end application.

If the application has connected the SYBASE server using gtrx_connection,
and the application is ideal. The this moment, the SYBASE server is
restarted.

And now, front-end application is used, and try to retrieve data from
SYBASE server, I have the following logic to handle this problem.

Disconnect using gtrx_connection;
Destroy gtrx_connection

gtrx_connection = Create transaction
Set transaction information
Connect using gtrx_connection;
<- Upon this point, the error "Ct_close(CS_UNUSED), user api layer:
enternal error: The connection has been marked dead" will prompted.

However, if the statement "Connect using gtrx_connection;" is runned again,
the connection success.

Does anyone know the reason, why the first time connection is fail?


Steve_Katz_[TeamSybase] Posted on 2003-06-04 15:34:29.0Z
Newsgroups: sybase.public.powerbuilder.objects
From: Steve_Katz_[TeamSybase]
Date: Wed, 4 Jun 2003 11:34:29 -0400
Subject: Re: Reconnect DB
Lines: 47
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Message-ID: <364_89CAC21865B7003F00558DD285256D3B.0036CAAA85256D31@webforums>
References: <364_2862390C5733CCFA003359B585256D31.003359D885256D31@webforums>
Path: forums-1-dub!forums-1-dub!forums-master.sybase.com!webforums.sybase.com!news
Xref: forums-1-dub sybase.public.powerbuilder.objects:7451
Article PK: 734739

>>In my application, a global connection (gtrx_connection) is used to
connect the a SYBASE server for operations.

To resolve the SYBASE server reboot issue, the following logic has been
built in my front-end application.

If the application has connected the SYBASE server using gtrx_connection,
and the application is ideal. The this moment, the SYBASE server is
restarted.

And now, front-end application is used, and try to retrieve data from
SYBASE server, I have the following logic to handle this problem.

Disconnect using gtrx_connection;
Destroy gtrx_connection

gtrx_connection = Create transaction
Set transaction information
Connect using gtrx_connection;
<- Upon this point, the error "Ct_close(CS_UNUSED), user api layer:
enternal error: The connection has been marked dead" will prompted.

However, if the statement "Connect using gtrx_connection;" is runned again,
the connection success.

Does anyone know the reason, why the first time connection is fail?
<<

After the disconnect, try checking the gtrx_connection.SQLCode and
SQLErrText just to see what it says - if it gives you any hints.

Are you sure you are not trying to reconnect before the server has come
back up and is ready for connections?

Have you tried running a db trace (adding "Trace" before your DBMS value in
the DBMS attribute of the transaction object (e.g. "SYC ..." becomes "Trace
SYC ..."). The trace log will sometimes give you additional information
that is not presented in the error messasge(s).

You shouldn't need to destroy, recreate, and reset the attributes of the
transaction object. Just a disconnect and connect should be sufficient.
This shouldn't affect what you're experiencing, but it is more efficient.

Also, is there some reason you are not using SQLCA? This shouldn't affect
what you're experiencing, but just curious.

steve
[TeamSybase]