Kathi, thank you for your detailed report. I had a look through your mapping files and they look fine. Your testing proves that they work in a single database.
For performance, app-schema converts queries against feature-chained types from database sources into efficient SQL, referred to as "joining": http://docs.geoserver.org/latest/en/user/data/app-schema/joining.html Joining cannot be used for feature chaining between databases because an SQL query can only be made against one database at a time. The evidence implicating joining is the mention in the stack trace of JoiningNestedAttributeMapping; this class is only used in app-schema joining. Joining is turned on by default. It is automatically turned off when using non-database sources, but I do not think that app-schema checks whether chaining is applied between database sources. As noted in the manual: "All feature mappings that are chained to each other must map to the same physical database." and "Failing to comply with any of these three restrictions when turning on Joining will result in exceptions thrown at run-time." To turn off app-schema chaining, set "app-schema.joining=false" in your app-schema.properties or as a JVM argument: http://docs.geoserver.org/latest/en/user/data/app-schema/joining.html#configuration Kind regards, Ben. On 24/08/16 22:06, Kathi Schleidt wrote: > Hi, > > In the process of trying to link features from multiple INSPIRE Themes > via Feature Chaining, I’ve run into difficulties using multiple (well 2) > databases (was trying to do one database per feature type/namespace). To > clarify that it’s not a problem with my configuration I put together a > simple example consisting of a main feature with two nested features, > one of which should stem from a different DB than the main parts. > (schema available at http://www.schleidt.org/schemas/test.xsd) > > Within the main DB (test2, DataStore idDataStoreTS), there are 2 tables: > > * testmain: the main part > > * nest: the part that should actually be in the other database > > Within the 2^nd DB (nest2, DataStore idDataStoreNS), there is only the > nest table (identical to the one in test, just different content to see > where the data is coming from) > > The DataStore configuration for both databases is identical except for > the database name (test2 vs nest2) > > As long as I’m only using the main database (test2), everything works > out beautifully. The moment I try to use the 2^nd database connection > (nest2), while there are no errors on startup, there are also no > features, just the following error (for ts:nestExt it should be going > for the table nest in the db nest2, but it’s complaining about the table > testmain from the db test2): > > java.lang.RuntimeException: Error applying mapping with targetAttribute > ts:nestExt > > Error applying mapping with targetAttribute ts:nestExt > > java.io.IOExceptionSchema 'testmain' does not exist. > > An interesting aside – when I set up this test, I first forgot to set up > my db as postgis (I’m an old geek, and spatial is still new to me). This > worked fine as long as I was only using one DB (there are no geometries > in my simple example), when I added the 2^nd one I got an interesting > PostGis error (might help in debugging): > > Function postgis_lib_version() doesn’t exist > > > Configuration and logfiles are available at: > http://www.schleidt.org/kathi/DBProblem.zip > > Main problem in the subdirectory PostGisDB, the 2 variants with just > PostGres are PostGres1 & 2 (for 1 or 2 dbs) > > Can somebody tell me if I'm going crazy or if there's a problem here? > > :) > > Kathi > > > > ------------------------------------------------------------------------------ > > > > _______________________________________________ > Geoserver-users mailing list > Geoserver-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/geoserver-users > -- Ben Caradoc-Davies <b...@transient.nz> Director Transient Software Limited <http://transient.nz/> New Zealand ------------------------------------------------------------------------------ _______________________________________________ Geoserver-users mailing list Geoserver-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geoserver-users