Multi-Threaded Application accessing diff Databases under diff instances

Multi-Threaded Application accessing diff Databases under diff instances

Post by Shyam » Sun, 07 Apr 2002 00:04:46



Hi,

I have written an application that collects performance data from
different databases under different DB2 instances (on same or
different nodes) using DB2 Client API. But I am running into some
issues here.

What I have seen is that you need an attachment to the DB2 Instance
(using sqleatin) to access any Database under it. So if I want to
access databases under the same instance that can be achieved but if I
want to access another database not under the same Instance, then the
application has to detach from the previous attachment and then attach
to the other instance in which case the attachment to the previous
Instance is lost making the databases under the old Instance
unaccessible.

To solve the above problem I found something called Multiple Thread
Database Access:

This API has calls like sqleSetTypeCtx, sqleBeginCtx, sqleAttachCtx
etc.

Though I have not used this part of the API yet, but as to what I
understand about these calls, these calls are again to assist
applications which want to access the same DB for
inserts/updates/select etc. and not for applications which want to
access different DBs under the same or different instances.(on same or
different nodes)

Is it a limitation with DB2 that a process can be attached to a single
Instance?

Has anyone tried this kind of an application?

If there is a way out of this, Can someone help me with it?

Regards,
Shyam

 
 
 

Multi-Threaded Application accessing diff Databases under diff instances

Post by David Penne » Mon, 08 Apr 2002 18:57:36


Shyam,

how many databases are you looking at - are they all DB2? Is this a large
problem you are solving. What level of expenditure would your problem
justify?  You might take a look at our website & leave a message for me when
you register (it will be routed directly to me rather than the sales group).

I just wonder if our federated data access platform might help - but it may
be a sledgehammer to crack a nut. Depends how many sources or how big a data
problem you are trying to manage.

We routinely access many databases in parallel & the source can be an api as
well as databases.

Regards,
              David Penney
              CTO-Europe
              http://www.metamatrix.com


Quote:> Hi,

> I have written an application that collects performance data from
> different databases under different DB2 instances (on same or
> different nodes) using DB2 Client API. But I am running into some
> issues here.

> What I have seen is that you need an attachment to the DB2 Instance
> (using sqleatin) to access any Database under it. So if I want to
> access databases under the same instance that can be achieved but if I
> want to access another database not under the same Instance, then the
> application has to detach from the previous attachment and then attach
> to the other instance in which case the attachment to the previous
> Instance is lost making the databases under the old Instance
> unaccessible.

> To solve the above problem I found something called Multiple Thread
> Database Access:

> This API has calls like sqleSetTypeCtx, sqleBeginCtx, sqleAttachCtx
> etc.

> Though I have not used this part of the API yet, but as to what I
> understand about these calls, these calls are again to assist
> applications which want to access the same DB for
> inserts/updates/select etc. and not for applications which want to
> access different DBs under the same or different instances.(on same or
> different nodes)

> Is it a limitation with DB2 that a process can be attached to a single
> Instance?

> Has anyone tried this kind of an application?

> If there is a way out of this, Can someone help me with it?

> Regards,
> Shyam


 
 
 

Multi-Threaded Application accessing diff Databases under diff instances

Post by Doug Dool » Thu, 11 Apr 2002 01:15:39


When you use the context API in a multi-threaded application, each
context must establish its own connection (may be to the same database
or a different one). I don't know if each context can establish its own
instance attachment or not.

If worst comes to worst, you could always catalog the other instances'
databases as remote database on one instance and then do all your work
through that instance.
--
_____________________________________________________________________
    Doug Doole
    DB2 Universal Database Development
    IBM Toronto Labs

Visit the DB2 UDB and DB2 Connect Online Support site at:
http://www.ibm.com/software/data/db2/udb/winos2unix/support

 
 
 

1. ADODB Connection String- Two Diff Examples - Two Diff Errors

Using VB6, Win2000.  I have inherited a VB project that was designed in
Win95, VB6 and am having some connection issues with.  I am trying to
different connection strings, listed below are the strings & errors, any
help is greatly appreciated.

While using the 1st connection string:

set mconn = new adodb.connection
mconn.connectionstring = _
"Provider=MSDAORA;" & _
"data source=" & user1.userhsdInstance_str & ";" & _
"user id=" & user1.userhsdnm_str & ";" & _
"password=" & user1.userhsdps_str

ERROR Received:
ADODB.Recordset reported 3251.  Object or Provider is not capable of
performing requested operation.

While using the 2nd connection string:
set mconn = new adodb.connection
mconn.connectionstring = _
"driver={MICROSOFT ODBC FOR ORACLE};" & _
"SERVER=" & user1.userhsdInstance_str & ";" & _
"UID=" & user1.userhsdnm_str & ";" & _
"PWD=" & user1.userhsdps_str

ERROR Received:
Microsoft OLD DB Provider for ODBC Drivers Reported -2147217900.
[Microsoft][ODBC Driver for ORACLE][ORACLE] ORA-20003.

If anyone knows what the issue could be, please pass it along.

Again .. any help is greatly appreciated.

SW

2. Not Spam: Price Comparison

3. Using the same access database in diff directory

4. Transfering data from one server to anouther

5. How access diff databases?

6. increasing the size of tempdb

7. Best Database/Report Solutions For VB 3.0

8. Forms-Diff DB Instances

9. Fw: Speed diff cause by multi-byte support

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

11. apply table changes to diff application on a different server