Hi,
We are using updateable Oracle views in a production system with some pretty old Geoserver so we know it works. It would be nice to know the dates of last changes in the related source files because that may prevent us from updating.
-Jukka Rahkonen-
···
Walter Stovall wrote
Re: [Geoserver-devel] Could a “simple” geoserver view become updatable?
Why would you think this problem is specific to Oracle? The code I’m changing is in JDBCFeatureSource.buildFeatureType() at its virtualTable != null test, which I would think applies to jdbc data sources in general, not just Oracle. Am I missing something there?
From: andrea.aime@…403… [mailto:andrea.aime@…403…] On Behalf Of Andrea Aime
Sent: Tuesday, May 9, 2017 12:50 PM
To: Walter Stovall <walter.stovall@…4309…>
Cc: geoserver-devel@lists.sourceforge.net
Subject: Re: [Geoserver-devel] Could a “simple” geoserver view become updatable?
Hi Water,
that may well be a regression, this use case you’re after is pretty uncommon and I’ve seen
it used only by Oracle users.
Since you can develop I’d make a pull request, with a test, by changing the following two extra files:
Cheers
Andrea
On Tue, May 9, 2017 at 6:45 PM, Walter Stovall <walter.stovall@…4309…> wrote:
From what I can tell use of the MetadataTablePrimaryKeyFinder does not matter. The code is still going to hit the test in JDBCFeatureSource.buildFeatureType() that decides to make the feature read-only if there’s a vtable. Fwiw the code was finding my primary key anyway by using Oracle data dictionary info. I had read-only then and now when using a pk metadata table I’m still read-only.
I changed the code and did a successful WFS-T Insert.
My edit changes this:
if(pkey == null || pkey instanceof NullPrimaryKey || virtualTable != null) {
To this:
if(pkey == null || pkey instanceof NullPrimaryKey) {
From: Walter Stovall
Sent: Tuesday, May 9, 2017 12:19 PM
To: ‘Andrea Aime’ <andrea.aime@…1268…>
Cc: geoserver-devel@lists.sourceforge.net
Subject: RE: [Geoserver-devel] Could a “simple” geoserver view become updatable?Yes it gets hit. But it seems like the only thing anything outside that class would call is getPrimaryKey. And that never gets hit.
From: andrea.aime@…403… [mailto:andrea.aime@…403…] On Behalf Of Andrea Aime
Sent: Tuesday, May 9, 2017 12:17 PM
To: Walter Stovall <walter.stovall@…4309…>
Cc: geoserver-devel@lists.sourceforge.netSubject: Re: [Geoserver-devel] Could a “simple” geoserver view become updatable?
Is the MetadataTablePrimaryKeyFinder hit and used?
I’d put breakpoints in it and have a look.
Cheers
Andrea
On Tue, May 9, 2017 at 6:13 PM, Walter Stovall <walter.stovall@…4309…> wrote:
I’m having trouble making updatable views work. I have the pk metadata table setup and configured.
Debugging the WFS-T I’m hitting this code in JDBCFeatureSource.buildFeatureType()…
// setup the read only marker if no pk or null pk or it’s a view
boolean readOnly = false;
if(pkey == null || pkey instanceof NullPrimaryKey || virtualTable != null) {
readOnly = true;
}
So pkey is setup but the virtualTable != null test then forces it read-only anyway – seems counter to what http://docs.geoserver.org/stable/en/user/data/database/primarykey.html#using-the-metadata-table-with-views says about being able to update views?
Can you suggest anything here?
Regards,
Walter Stovall
Byers Engineering Company
From: andrea.aime@…403… [mailto:andrea.aime@…403…] On Behalf Of Andrea Aime
Sent: Tuesday, May 9, 2017 8:23 AM
To: Walter Stovall <walter.stovall@…4309…>
Cc: geoserver-devel@lists.sourceforge.net
Subject: Re: [Geoserver-devel] Could a “simple” geoserver view become updatable?On Tue, May 9, 2017 at 1:30 PM, Walter Stovall <walter.stovall@…4309…> wrote:
My application builds geoserver layers that are based on a “view” as defined by a Oracle SELECT statement pasted into the geoserver layer editor. By using a view my layer becomes read-only, but I want to update via WFS-T transactions.
The configure it accordingly
Cheers
Andrea
–
==
GeoServer Professional Services from the experts! Visit
http://goo.gl/it488V for more information.
==
Ing. Andrea Aime
@geowolf
Technical Lead
GeoSolutions S.A.S.
Via di Montramito 3/A
55054 Massarosa (LU)phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549
http://twitter.com/geosolutions_it
AVVERTENZE AI SENSI DEL D.Lgs. 196/2003
Le informazioni contenute in questo messaggio di posta elettronica e/o nel/i file/s allegato/i sono da considerarsi strettamente riservate. Il loro utilizzo è consentito esclusivamente al destinatario del messaggio, per le finalità indicate nel messaggio stesso. Qualora riceviate questo messaggio senza esserne il destinatario, Vi preghiamo cortesemente di darcene notizia via e-mail e di procedere alla distruzione del messaggio stesso, cancellandolo dal Vostro sistema. Conservare il messaggio stesso, divulgarlo anche in parte, distribuirlo ad altri soggetti, copiarlo, od utilizzarlo per finalità diverse, costituisce comportamento contrario ai principi dettati dal D.Lgs. 196/2003.
The information in this message and/or attachments, is intended solely for the attention and use of the named addressee(s) and may be confidential or proprietary in nature or covered by the provisions of privacy act (Legislative Decree June, 30 2003, no.196 - Italy’s New Data Protection Code).Any use not in accord with its purpose, any disclosure, reproduction, copying, distribution, or either dissemination, either whole or partial, is strictly forbidden except previous formal approval of the named addressee(s). If you are not the intended recipient, please contact immediately the sender by telephone, fax or e-mail and delete the information in this message that has been received in error. The sender does not give any warranty or accept liability as the content, accuracy or completeness of sent messages and accepts no responsibility for changes made after they were sent or for other risks which arise as a result of e-mail transmission, viruses, etc.
–
==
GeoServer Professional Services from the experts! Visit
http://goo.gl/it488V for more information.
==
Ing. Andrea Aime
@geowolf
Technical Lead
GeoSolutions S.A.S.
Via di Montramito 3/A
55054 Massarosa (LU)phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549
http://twitter.com/geosolutions_it
AVVERTENZE AI SENSI DEL D.Lgs. 196/2003
Le informazioni contenute in questo messaggio di posta elettronica e/o nel/i file/s allegato/i sono da considerarsi strettamente riservate. Il loro utilizzo è consentito esclusivamente al destinatario del messaggio, per le finalità indicate nel messaggio stesso. Qualora riceviate questo messaggio senza esserne il destinatario, Vi preghiamo cortesemente di darcene notizia via e-mail e di procedere alla distruzione del messaggio stesso, cancellandolo dal Vostro sistema. Conservare il messaggio stesso, divulgarlo anche in parte, distribuirlo ad altri soggetti, copiarlo, od utilizzarlo per finalità diverse, costituisce comportamento contrario ai principi dettati dal D.Lgs. 196/2003.
The information in this message and/or attachments, is intended solely for the attention and use of the named addressee(s) and may be confidential or proprietary in nature or covered by the provisions of privacy act (Legislative Decree June, 30 2003, no.196 - Italy’s New Data Protection Code).Any use not in accord with its purpose, any disclosure, reproduction, copying, distribution, or either dissemination, either whole or partial, is strictly forbidden except previous formal approval of the named addressee(s). If you are not the intended recipient, please contact immediately the sender by telephone, fax or e-mail and delete the information in this message that has been received in error. The sender does not give any warranty or accept liability as the content, accuracy or completeness of sent messages and accepts no responsibility for changes made after they were sent or for other risks which arise as a result of e-mail transmission, viruses, etc.
–
==
GeoServer Professional Services from the experts! Visit
http://goo.gl/it488V for more information.
==
Ing. Andrea Aime
@geowolf
Technical Lead
GeoSolutions S.A.S.
Via di Montramito 3/A
55054 Massarosa (LU)
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549
http://twitter.com/geosolutions_it
AVVERTENZE AI SENSI DEL D.Lgs. 196/2003
Le informazioni contenute in questo messaggio di posta elettronica e/o nel/i file/s allegato/i sono da considerarsi strettamente riservate. Il loro utilizzo è consentito esclusivamente al destinatario del messaggio, per le finalità indicate nel messaggio stesso. Qualora riceviate questo messaggio senza esserne il destinatario, Vi preghiamo cortesemente di darcene notizia via e-mail e di procedere alla distruzione del messaggio stesso, cancellandolo dal Vostro sistema. Conservare il messaggio stesso, divulgarlo anche in parte, distribuirlo ad altri soggetti, copiarlo, od utilizzarlo per finalità diverse, costituisce comportamento contrario ai principi dettati dal D.Lgs. 196/2003.
The information in this message and/or attachments, is intended solely for the attention and use of the named addressee(s) and may be confidential or proprietary in nature or covered by the provisions of privacy act (Legislative Decree June, 30 2003, no.196 - Italy’s New Data Protection Code).Any use not in accord with its purpose, any disclosure, reproduction, copying, distribution, or either dissemination, either whole or partial, is strictly forbidden except previous formal approval of the named addressee(s). If you are not the intended recipient, please contact immediately the sender by telephone, fax or e-mail and delete the information in this message that has been received in error. The sender does not give any warranty or accept liability as the content, accuracy or completeness of sent messages and accepts no responsibility for changes made after they were sent or for other risks which arise as a result of e-mail transmission, viruses, etc.