First of all - thanks for your reply.
In the following text, user1 can access host1 hosting db1 which
contains table1, and the same for user2, host2, db2 and table2.
So, sorry for that. I accidentally forgot that I already changed my
code because I was trying some more or less useful things for
bugtracking.
The original code produces a different error: "Table db1.table2 does
not exist." This is true, of course - but the error only occurs
because AR is using the wrong db connection (namely a connection to
host1 which has db1 as default schema). But table2 is in db2 on host2,
and I can reach host2 only by using the "different database
connection" because I MUST close the connection to host2 after the
transaction immediately.
So I came to the conclusion that AR still uses the existing default
connection (to db1) and tries to access table2 instead of using the
"different database" to do this. And THAT is my problem.
- Andy
P.S.: The error that I mentioned my original post occurs when I
specify the correct schema in the AR table class of table2. But this
schema (db2) does not exist on host1 (to which AR connects wrongly).
And for some weird reason, MySQL says that the user1 is not allowed to
SELECT from db2.table2 on host1 - but the correct error message would
be "database db2 does not exist on host1".
On 6 Nov., 18:08, Markus Zywitza <
markus.zywi...@gmail.com> wrote:
> The DifferentDatabaseScope is not meant to be experimental. From what
> you write, I think AR is using the connection. If it used the main
> connection, how could it fail with this connection's credentials?
>
> So my guess is, the connection is used, but somehow AR/NH tries to
> re-open the connection with the wrong credentials.
>
> Can you create a Donjon issue with a failing test or example project?
>
> -Markus
>
> 2009/11/5 Andy <
a.bonga...@gmx.de>: