[Info-ingres] RE: OpenAPI Weirdness



Hi Grant et al,

Sorry to bother you directly Grant, but I'm at my wits end on this one
and could use some advice. If anyone else in the newsgroup would like
to chip in 2c worth, I'd be happy too.

I've written a C program which has a subroutine full of API stuff. This
subroutine controls connecting to three databases in sequence to do
stuff. From the final database connection it reads in a lot (17511 rows)
of data to the program before disconnecting and then terminating the
API before returning to the main program.

All of which appears to work perfectly well. The data returned to the
program is exactly what is in the database.

But after the IIapi_terminate succeeds, the subroutine will return a
TRUE. Diagnostics indicates this is all happening. But the subroutine
NEVER returns to the main program. Instead it either loops? or causes
a coredump.

The code is literally:
main (...) {
if (Generate_Analysed_Data(&SayWhat)) {
printf("Generate_Analysed_Data completed OK!\n");
} else {
printf("Unexpected Error: Failed to Generate Analysed Data\n");
printf("Program Aborts\n");
exit (1);
};
} /*main*/

int Generate_Analysed_Data ( ParmDetails *buf) {
.... stuff ...
/* Initialise OpenAPI */
if (!Init_API(&InitParm)) {return(FALSE);};
.... Lots of stuff ...
/* In all cases we an now terminate the API connection */
printf("Terminate me!\n");
if (!Terminate_API) {
printf("Failure in API termination!\n");
ret_value=FALSE;
};

printf("Generate_Analysed_Data returns %d\n", ret_value);
return (ret_value);
} /*Generate_Analysed_Data*/

int Terminate_API (void) {
IIAPI_TERMPARM termParm;
IIapi_terminate(&termParm);
if ( termParm.tm_status != IIAPI_ST_SUCCESS ) {
printf( "Open_API::Terminate_API. Error in IIapi_terminate: %d\n",
termParm.tm_status );
};
return termParm.tm_status;
} /*Terminate_API*/

The diagnostic output is:
Terminate me!
Generate_Analysed_Data returns 1
Segmentation fault (core dumped)


I've run in api_trace mode (5) and the trace file (1.2M) is beautiful:
grep 'status =' $II_SYSTEM/ingres/files/api_trace.log| grep -v
SUCCESS
!IIapi_appCallback: request completed, status = NO_DATA

All the connects/disconnects are cool. All started statements are
closed, commits are issued etc.

I've run this on II2.5 and from an II2.6 installation using vnodes back to
the II2.5 database and the effect is the same.

Any Ideas gratefully received. I have the core dump and dbx but I have
no idea what I'm looking for or how to drive dbx....

Martin Bowes
--
Random Duckman Quote #20:
Ajax - By the hand of Zeus what manner of deviltry is this?
I mean... what gives?


.



Relevant Pages

  • Re: 3vl 2vl and NULL
    ... > or API to the stored data is of primarily interest to me. ... >> designers are capable of defining the world for application programmers, ... I am more of an end-user (aka developer) looking to those ... But building an enterprise database is a lot more than succeeding at a lot ...
    (comp.databases.theory)
  • Re: Connect to Access Data from various regional locations
    ... All users will be connecting via broadband. ... When using MSDE ... > Dim rf As DAO.Recordset ... > There is a wizard to split your database into a FE and a BE; ...
    (microsoft.public.access.externaldata)
  • Re: Connect to Access Data from various regional locations
    ... All users will be connecting via broadband. ... When using MSDE ... > Dim rf As DAO.Recordset ... > There is a wizard to split your database into a FE and a BE; ...
    (microsoft.public.access.dataaccess.pages)
  • Procedurally Generated Node Demo
    ... nodecoll(1 To nodemax) As Integer 'List of connected nodes ... The subroutine AddNode adds a new node to the list. ... When connecting rooms, add a node when the corridor changes direction, or if the corridor ends in another corridor. ... If there isn't a target node selected, find the nearest node in sight and set as target. ...
    (rec.games.roguelike.development)
  • Re: GEDOM as a database format
    ... proprietary database, without the need for convoluted import/export. ... utility conforming to the description of that API. ... I can see commercial vendors having valid grounds for objecting if they were then expected to provide support for databases mangled by anything from well-meaning but ill-designed 3rd party tools to direct tweaking. ... any software author with strong feelings about non-SQL RDMBS such as rdb or about using persistent objects would rightly feel excluded - and who's to say such implementations may not be better? ...
    (soc.genealogy.computing)