Local Host variables for multi-threaded embedded sql 
Author Message
 Local Host variables for multi-threaded embedded sql

Regarding the{*filter*} bind: You are likely waiting on a catalog lock.
While an program is running we keep a lock on its package.  During a
bind, we need to insert/update rows in the catalog.  If the bind needs
to lock the same catalog rows as a running application, the bind will
hang until the running application releases its locks.  To release the
package lock, the application must disconnect from the database.

In the example you quoted, the declaration of host_var_3 is thread
safe, but the function are not.  In addition to any host variables,
you also need an SQLCA for each statement.  Since no SQLCA was defined
in the functions, they would be sharing the global SQLCA created by
the "EXEC SQL INCLUDE SQLCA;" statement (which doesn't appear in the
example).  To make the functions thread safe, you'd also need to add
the declaration "struct sqlca sqlca;" to both functions.

Hope this helps.
___________________________________________________________________________
    Doug Doole
    DB2 Universal Database Development
    IBM Toronto Labs



Sat, 23 Jun 2001 03:00:00 GMT
 Local Host variables for multi-threaded embedded sql

Why doesn't the bind get a -911 like on os390 ?
Quote:

> Regarding the{*filter*} bind: You are likely waiting on a catalog lock.
> While an program is running we keep a lock on its package.  During a
> bind, we need to insert/update rows in the catalog.  If the bind needs
> to lock the same catalog rows as a running application, the bind will
> hang until the running application releases its locks.  To release the
> package lock, the application must disconnect from the database.

> In the example you quoted, the declaration of host_var_3 is thread
> safe, but the function are not.  In addition to any host variables,
> you also need an SQLCA for each statement.  Since no SQLCA was defined
> in the functions, they would be sharing the global SQLCA created by
> the "EXEC SQL INCLUDE SQLCA;" statement (which doesn't appear in the
> example).  To make the functions thread safe, you'd also need to add
> the declaration "struct sqlca sqlca;" to both functions.

> Hope this helps.
> ___________________________________________________________________________
>     Doug Doole
>     DB2 Universal Database Development
>     IBM Toronto Labs



Tue, 03 Jul 2001 03:00:00 GMT
 Local Host variables for multi-threaded embedded sql
You need to enable lock timeout (the LOCKTIMEOUT database
configuration parameter).
___________________________________________________________________________
    Doug Doole
    DB2 Universal Database Development
    IBM Toronto Labs


Tue, 03 Jul 2001 03:00:00 GMT
 
 [ 5 post ] 

 Relevant Pages 

1. Multi-threading Ingres embedded SQL in C

2. Multi-thread capability and non-threaded applications ...

3. Embedded sql/cobol-Host,Aplication vars

4. Selecting Directly into a Cobol Host Table (array) via Embedded SQL

5. output from host commands embedded in sql as !!

6. Embedded SQL for Windows NT & Threads

7. embedded sql 11 and thread?

8. Embedded SQL/Thread Safety/C++

9. Host Variables as class member variables

10. HELP!! Using Embedded SQL with Interbase Local Server

11. ODBC and MS SQL and multi-threaded app.


 
Powered by phpBB® Forum Software