473,386 Members | 1,752 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Using multiple database contexts

Hi,

I have a program in C/C++, with embedded SQL, with a single thread of
execution. I am trying to establish two database connections, to the
same database, so I can have concurrent, independant transactions.
(deadlocks, locking etc. is not an issue because different set of
tables are accessed, always).

The code does not call sqleSetTypeCtx.
My first question is: What is the exact purpose of this function? Is it
just to provide synchronization when multiple threads are trying to
access the database?

What the code does is - it acts as normal, one-database,
single-threaded application - issues EXEC SQL CONNECT ... executes some
SQL statements (update/delete/insert/select) ... and at some point it
decides to establish second database connection, if it is not already
established, (this can be in a middle of a transaction in the first
connection).
The code uses the Admininistrative API to create new context, attach to
it, run EXEC SQL CONNECT ... and some SQL statements, and at the end
detaches from the new context.

This setup seems to work Ok when compiled with DB2 8.2 client.
But if it is compiled with DB2 7 client, the second connection attempt
fails with SQL0752N error.

All functions that deal with establishing database connection have
their own sqlca-s and do not share variables.

Any suggestions what the problem could be are appreciated.

Thanks,

D.

Feb 15 '06 #1
0 1523

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

112
by: Andy | last post by:
Hi All! We are doing new development for SQL Server 2000 and also moving from SQL 7.0 to SQL Server 2000. What are cons and pros for using IDENTITY property as PK in SQL SERVER 2000? Please,...
17
by: Steve Jorgensen | last post by:
Terminology question: Is there a term for a set of records related directly or indirectly by key value in several tables? For example, a single invoice record and its line item records -or- a...
17
by: Danny J. Lesandrini | last post by:
The following code works with a standard MDB to navigate to a particluar record (with a DAO recordset, of course) but it's giving me problems in an ADP I'm working on. Dim rs As ADODB.Recordset...
22
by: Bradley | last post by:
Has anyone else noticed this problem? I converted the back-end to A2000 and the performance problem was fixed. We supply a 97 and 2000 version of our software so we kept the backend in A97 to make...
2
by: Peter Bär | last post by:
A Question to the C#/.Net Gods of this forum: are there performance penalties when i compile (C#, FW1.1, ASP.NET, Studio2003) a central baseclass in a different assembly than all the derived...
5
by: Jeremy | last post by:
I have a core VB service that monitors a database, and based on data in the records will execute code to send email notifications. Problem: I don't want my main program code to halt and wait for...
60
by: Shawnk | last post by:
Some Sr. colleges and I have had an on going discussion relative to when and if C# will ever support 'true' multiple inheritance. Relevant to this, I wanted to query the C# community (the...
10
by: Petr Jakeš | last post by:
I have a standard 12-key mobile phone keypad connected to my Linux machine as a I2C peripheral. I would like to write a code which allows the text entry to the computer using this keypad (something...
7
by: Olegus | last post by:
Hello, in order to perform backup/restore MSSQL database using SMO, one needs to reference several namespaces in a backup class : using Microsoft.SqlServer.Management.Common; using...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.