comp.lang.ada
 help / color / mirror / Atom feed
From: Elie Zgheib <egzgheib@gmail.com>
Subject: Many Database Connections
Date: Thu, 27 Jan 2011 09:00:17 -0800 (PST)
Date: 2011-01-27T09:00:17-08:00	[thread overview]
Message-ID: <99d20061-de06-4383-8675-e1abd9803b0d@o10g2000vbg.googlegroups.com> (raw)

Hello everybody!

I am trying to write a code that maintains 2 connections to 2
different databases (on the same server).
The databases are is Postgre and I am using GnatColl to interface with
the servers and execute queries.

The problem I am having is that after executing a query on one of the
databases by using connection, the subsequent queries will be executed
to that same database even if I am using different connections.

To clarify this, imagine that I have 2 Databases, DB1 and DB2. I have
2 Gnatcoll databases connectors pointing to each one, lets say DB1_Con
for the connector to DB1, and DB2_Con for the other. I execute the
query on DB1 by calling Execute (DB1_Con, "INSERT t1 ...."), then call
the procedure Execute (DB2_Con, "INSERT t2..."). The second call to
Execute will fail because it tried to insert in DB1 and since DB1 does
not have a t2 table, it fails!!!

Has anybody experienced this? or has anybody successfully done this?
if so how? Any advise on what to look for while doing this sort of
stuff?

Thanks guys

Elie



             reply	other threads:[~2011-01-27 17:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-27 17:00 Elie Zgheib [this message]
2011-01-27 21:37 ` Many Database Connections Emmanuel Briot
2011-01-28 12:10   ` iloAda
2011-01-28 15:22     ` Emmanuel Briot
2011-01-31 14:12       ` iloAda
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox