![]() | |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hi, My application is an Open Server Application connecting to Sybase 12.5 database. The version of open server & client libraries are OPENSVR_REL=12.5_32bit_10072 & OPENCLIENT_REL=12.5_32bit_10657. We are using RW SourcePro 4.0 on Solaris 8.0 with Sun Forte Rel 6.2. During the application start up it is able to connect to Sybase database. The statement to get the database connection is as follows: RWDBManager::setErrorHandler (errorHandler); cerr << "Before RWDBManager::database" << endl; const char * database_access_method = "libctl5215d.so"; dBase = RWDBManager::database (database_access_method, direct_server, direct_user, direct_password, direct_db); cerr << "After RWDBManager::database" << endl; if (dBase.isValid ()) { cerr << "Connected to DB!" << endl; //on output this mesg. is displayed. } else { dBase.setErrorHandler(errorHandler); cerr << "Set error handler" << endl; } The same connection is then used for further database queries in another file. It is at this time the following error pops up: [VENDORLIB] Vendor Library Error: ct_connect(): user api layer: internal common library error: There is an internal error in the user api layer. Error number: 17040941 Severity: 6 ZZZZZ The statement where it is giving error is mentioned below.It is the first statement in the application that is trying to hit database after getting the connection during application start up. //db is connection at app start up if (!get_rate_schedule_sp.isValid ()) { RWCString spname = "dbo.GetRateSchedule_sp"; get_rate_schedule_sp = db.storedProc (spname); } Please provide your insight about the probable cause of errors. Please also tell me what are the configuration settings that I should look for it. Thanks. Prashant |
#3
| |||
| |||
|
#4
| |||
| |||
|
|
Hi, Thanks for your response. I tried some more things with the application to find the place where trying to connect to Sybase 12.5 database fails. The main() function where it is happening is listed for your reference. I have to use a wrapper library that conatins the functionality for open server. //code listing BEGIN #include <ctOSUtils.h #include <ctOSConfigurableOpenServer.h #include <rw/db/dbase.h #include <rw/db/dbmgr.h #include <rw/db/stored.h #include <unistd.h // functions local to this file #define SRV__SPRINTF sprintf const char * database_access_method = "libctl5215d.so"; int getargs(int argc, char **argv); RWBoolean get_db_login (); RWDBDatabase dBase; // Global data RWCString direct_server = ""; RWCString direct_db = ""; RWCString direct_user = ""; RWCString direct_password = ""; RWDBConnection ai_connection ; RWDBMemTable mt_ai_format ; RWDBMemTable mt_curr_xref ; RWDBMemTable mt_day_types ; RWCString process_date; char li_flag; // Holds the character used by CcDtconvert to // determine which ccholly files to use char Msg [1024]; OSConfigurableOpenServer *os = NULL; void start_handler(OSConfigurableOpenServer *); void init(OSConfigurableOpenServer *); // // The main program section // main (int argc, char **argv) { // Debug hook if(getenv("CSDEBUG")) { cout << "\n---- Waiting for debugger to be attached." << endl; sleep(60); } // Read any command line arguments. getargs(argc, argv); /* Till this point able to connect to database again */ os = new OSConfigurableOpenServer(argc, argv, init, start_handler); /* At this point also NOT able to connect to database again */ os->run (); exit(STDEXIT); } // // start_handler() // // This is the SRV_START event handler. It registers the // procedures that this Open Server can process. // void start_handler(OSConfigurableOpenServer *s) { SRV_PROC *srvproc; int ret; SRV_SERVER *server; /* From this point not able to connect to database, so if I write the dBase = RWDBManager::database (database_access_method, direct_server, direct_user, direct_password, direct_db); it gives the Vendor Library Error: ct_connect(): user api layer: internal common library error */ server = s->get_srvserver(); // // Create a temporary service process to use in registering the // procedures. // if ((srvproc = srv_createproc(server)) == (SRV_PROC *)NULL ) { cerr << "Failed to create service process.\n" ; exit(1); } //CODE TO ADD VARIOUS BUSINESS FUNCTIONS CALLBACK // // Don't need the service SRV_PROC anymore, so drop it. // srv_dropproc (srvproc); return; // (SRV_CONTINUE); } RWBoolean get_db_login () { //code for getting the username, password etc. direct_server = (const char*) getenv("DSQUERY"); direct_db = (const char*) getenv("CS_DB"); direct_user = (const char*) getenv("CS_DB_LOGIN"); direct_password = (const char*) getenv("CS_DB_PASSWD"); RWDBManager::setErrorHandler (errorHandler); cerr << "Before RWDBManager::database" << endl; dBase = RWDBManager::database (database_access_method, direct_server, direct_user, direct_password, direct_db); if (dBase.isValid ()){ cerr << "CONNECTED TO DB!" << endl; } else { dBase.setErrorHandler(errorHandler); cerr << "Set error handler" << endl; } ai_connection = dBase.connection(); return dBase.isValid (); } //code listing END The application is using thread safe libraries. The application is working fine on Solaris 6/Sybase 11.9/Open Client 11.1 and gives this error when migrated to Solaris 8/Sybase 12.5/Open Client 12.5 I tried connecting the application to old sybase version(11.9) but still it gives the same error. Any insight provided by you will be very helpful. Thanks. Prashant |
![]() |
| Thread Tools | |
| Display Modes | |
| |