I got cross-database queries working just recently, with a boost from
Michael Gentry. I'd guess the culprit is that your nodes are missing the
datasource. For example:
<node name="DataNode"
datasource="DataNode.driver.xml" // tell the node how to connect
to the database
In fact I'm kinda surprised it works at all. The modeler won't load the
file. Maybe your note didn't include an exact copy.
On Tue, Jun 5, 2012 at 2:08 AM, Gary Jarrel <[email protected]> wrote:
> Hi Guys,
>
> Just started a new project using Cayenne 3.1M3 set up some test code
> to see whether I can get the cross database queries to work, but it
> seems that every time I run a query across the 2 database it tries to
> use the 1 database and hence crashes out with:
>
> com.microsoft.sqlserver.jdbc.SQLServerException: Invalid object name
> 'dbo.client_contracts'.
>
> The client_contracts table is located in the second database which it
> does not seem to use.
>
> I have 2 datamaps, 2 data nodes and a single cayenne-xxx.xml file. A
> copy of the file is below, and I am certain that I have done this
> before without too much hassles at all.
>
> <domain project-version="6">
> <map name="jay"/>
> <map name="jayExtranet"/>
>
> <node name="jayExtranetNode"
>
> factory="org.apache.cayenne.configuration.server.JNDIDataSourceFactory"
> parameters="java:comp/env/jdbc/jayExtranet"
>
> schema-update-strategy="org.apache.cayenne.access.dbsync.SkipSchemaUpdateStrategy">
> <map-ref name="jayExtranet"/>
> </node>
> <node name="jayNode"
>
> factory="org.apache.cayenne.configuration.server.JNDIDataSourceFactory"
> parameters="java:comp/env/jdbc/jay"
>
> schema-update-strategy="org.apache.cayenne.access.dbsync.SkipSchemaUpdateStrategy">
> <map-ref name="jay"/>
> </node>
> </domain>
>
> Any thoughts would be greatly appreciated!
>
> Thank you
>
> Gary
>