From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,4ef7e3d0c7ac8809,start X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!postnews.google.com!o10g2000vbg.googlegroups.com!not-for-mail From: Elie Zgheib Newsgroups: comp.lang.ada Subject: Many Database Connections Date: Thu, 27 Jan 2011 09:00:17 -0800 (PST) Organization: http://groups.google.com Message-ID: <99d20061-de06-4383-8675-e1abd9803b0d@o10g2000vbg.googlegroups.com> NNTP-Posting-Host: 137.194.58.115 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: posting.google.com 1296147618 18483 127.0.0.1 (27 Jan 2011 17:00:18 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Thu, 27 Jan 2011 17:00:18 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: o10g2000vbg.googlegroups.com; posting-host=137.194.58.115; posting-account=r1a26AoAAAD4nbikbegb_8j7mwzetiwY User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux i686; fr; rv:1.9.0.19) Gecko/2010120923 Iceweasel/3.0.6 (Debian-3.0.6-3),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:16742 Date: 2011-01-27T09:00:17-08:00 List-Id: 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