If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Informix > ESQL/C OPTMSG problem

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-05-04, 06:01
jrueschenschmid jrueschenschmid is offline
Registered User
 
Join Date: Feb 2004
Posts: 1
ESQL/C OPTMSG problem

Hi everybody,

i am busy in writing an application for Informix using multiple database connections with concurrent transactions and optimized message transfer (OPTMSG) feature of ESQL/C library.

Currently no flush of chained statements will be done in case a new connection will be started or a switch to another connection will be done.
In my opinion it is okay that ESQL/C don't do a automatic flush because we are using concurrent transactions. However i need to flush all chained statements before a new connection will be set and
i would like to continue to use of OPTMSG feature for performance reasons.

Here is an simplified ESQL/C program to explain my problem

main()
{
EXEC SQL BEGIN DECLARE SECTION;
char dbname[] = "db";
char userid[] = "informix";
char passwd[] = "informix";
char query[512];
char sqlcmd[512];
EXEC SQL END DECLARE SECTION;

EXEC SQL WHENEVER ERROR STOP;

ifx_putenv( "OPTMSG=1" );

EXEC SQL connect to :dbname AS 'con1' USER :userid USING asswd with concurrent transaction;
EXEC SQL BEGIN WORK;
sprintf(query,"SELECT * FROM t1");
EXEC SQL PREPARE s_1 FROM :query;
EXEC SQL DECLARE c_1 CURSOR FOR s_1;
EXEC SQL OPEN c_1;

OptMsg = 1;
EXEC SQL CLOSE c_1;
OptMsg = 0; // close statement will be chained

EXEC SQL connect to :dbname AS 'con2' USER :userid USING asswd with concurrent transaction;
EXEC SQL BEGIN WORK;
sprintf(sqlcmd,"drop table t1");
EXEC SQL EXECUTE IMMEDIATE :sqlcmd; // error -214 appears because the close to to cursor c_1 is not flushed yet
EXEC SQL COMMIT WORK;
}

I have two questions :

1.) is it possible to get informations about if something is currently chained for a connection ?
2.) in case something is chained i would like to force a flush. How to do ?

Maybe somebody can help me in this issue.

Regards ...
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On