Home > Archive > SQL Anywhere ultralite > October 2005 > StaticAPI(ReOpen())-> Component(?)









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author StaticAPI(ReOpen())-> Component(?)
Srini

2005-10-03, 3:23 am

Hello All,

Iam converting a StaticAPI application into component based
app.
In the StaticAPI app the ReOpen() function is used ,is there
any analogus mehtod to it in ComponentAPI? Or is there any
other way of acheving the ReOpen Functionality in
ComponentAPI?

Regards,
Srini
Srini

2005-10-03, 3:23 am

I mean is there any way of implementing the following logic
using Component API?

case LAUNCH_SUCCESS_FIRST
:
if( !db.Open() ){
// initialization failed: add error handling here
break;
}
// fall through
case LAUNCH_SUCCESS:
db.Reopen();
// do work here
break;
case LAUNCH_FAIL:
// error
break;
/***************/
> Hello All,
>
> Iam converting a StaticAPI application into component
> based app.
> In the StaticAPI app the ReOpen() function is used ,is
> there any analogus mehtod to it in ComponentAPI? Or is
> there any other way of acheving the ReOpen Functionality
> in ComponentAPI?
>
> Regards,
> Srini

Tim McClements

2005-10-27, 7:41 am

Yes, the C++ Component has the same suspend/restore functionality. Have a
look at the custdb sample implemented in custdbcomp.cpp (CDemoDB::Init()
specifically). Basically, connections are automatically restored (you don't
have to write special reopen code), and cursors/tables you want restored are
simply given a persistent name (again no special reopen code). You can query
to see if something was restored by checking for the warnings
SQLE_CONNECTION_REST
ORED and SQLE_CURSOR_RESTORED
immediately following the
respective open call. See the docs for the full story.

- Tim


<Srini> wrote in message news:4340c3f1.6107.1681692777@sybase.com...[color=darkred]
>I mean is there any way of implementing the following logic
> using Component API?
>
> case LAUNCH_SUCCESS_FIRST
:
> if( !db.Open() ){
> // initialization failed: add error handling here
> break;
> }
> // fall through
> case LAUNCH_SUCCESS:
> db.Reopen();
> // do work here
> break;
> case LAUNCH_FAIL:
> // error
> break;
> /***************/


Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com