[Geoserver-devel] Could a "simple" geoserver view become updatable?

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:

https://github.com/geotools/geotools/blob/master/modules/plugin/jdbc/jdbc-oracle/src/test/java/org/geotools/data/oracle/OracleViewTestSetup.java

https://github.com/geotools/geotools/blob/master/modules/plugin/jdbc/jdbc-oracle/src/test/java/org/geotools/data/oracle/OracleViewOnlineTest.java

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.net

Subject: 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 :wink:

http://docs.geoserver.org/stable/en/user/data/database/primarykey.html#using-the-metadata-table-with-views

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://www.geo-solutions.it

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://www.geo-solutions.it

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://www.geo-solutions.it

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.


Without testing old releases I can’t say for sure when this lack of support for updatable views was introduced. What I can say is that indications are, this is a long standing problem. I went back to rev 84d6dc7 posted six years ago and I see the same “virtualTable != null” test there. But again there might be reasons why the old codebase did not execute this code, the readOnly flag might have been undone downstream, etc…

As far as real test goes I can only say that this problem is for sure in v2.8 of GeoServer. I don’t have earlier experience working with updatable views.

···

From: Rahkonen Jukka (MML) [mailto:jukka.rahkonen@…4189…]
Sent: Wednesday, May 10, 2017 7:22 AM
To: Walter Stovall <walter.stovall@…4309…>
Cc: geoserver-devel@lists.sourceforge.net
Subject: Re: [Geoserver-devel] Could a “simple” geoserver view become updatable?

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:

https://github.com/geotools/geotools/blob/master/modules/plugin/jdbc/jdbc-oracle/src/test/java/org/geotools/data/oracle/OracleViewTestSetup.java

https://github.com/geotools/geotools/blob/master/modules/plugin/jdbc/jdbc-oracle/src/test/java/org/geotools/data/oracle/OracleViewOnlineTest.java

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.net

Subject: 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 :wink:

http://docs.geoserver.org/stable/en/user/data/database/primarykey.html#using-the-metadata-table-with-views

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://www.geo-solutions.it

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://www.geo-solutions.it

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://www.geo-solutions.it

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.


Hi Jukka,
as Walter says, that code is pretty old (2011?). I’ve also done a quick check,
the readOnly flag is used to setup a flag in the feature type being built, which in
turn is used to decide whether to create a featureSource (read only) or a featureStore
(writable) and that has also the same age.

I’d guess it was working by accident back then, and the “accident” got solved
in the meantime. Hard to say what or why without more investigation

Cheers
Andrea

···

On Wed, May 10, 2017 at 1:22 PM, Rahkonen Jukka (MML) <jukka.rahkonen@anonymised.com> wrote:

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@anonymised.com03… [mailto:andrea.aime@anonymised.com] On Behalf Of Andrea Aime
Sent: Tuesday, May 9, 2017 12:50 PM
To: Walter Stovall <walter.stovall@anonymised.com>
Cc: geoserver-devel@anonymised.comsourceforge.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:

https://github.com/geotools/geotools/blob/master/modules/plugin/jdbc/jdbc-oracle/src/test/java/org/geotools/data/oracle/OracleViewTestSetup.java

https://github.com/geotools/geotools/blob/master/modules/plugin/jdbc/jdbc-oracle/src/test/java/org/geotools/data/oracle/OracleViewOnlineTest.java

Cheers

Andrea

On Tue, May 9, 2017 at 6:45 PM, Walter Stovall <walter.stovall@anonymised.com> 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@anonymised.com>
Cc: geoserver-devel@anonymised.comsourceforge.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@anonymised.com [mailto:andrea.aime@anonymised.com] On Behalf Of Andrea Aime
Sent: Tuesday, May 9, 2017 12:17 PM
To: Walter Stovall <walter.stovall@anonymised.com>
Cc: geoserver-devel@anonymised.comsourceforge.net

Subject: 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@anonymised.com> 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@anonymised.com [mailto:andrea.aime@anonymised.com] On Behalf Of Andrea Aime
Sent: Tuesday, May 9, 2017 8:23 AM
To: Walter Stovall <walter.stovall@anonymised.com>
Cc: geoserver-devel@anonymised.comsourceforge.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@anonymised.com> 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 :wink:

http://docs.geoserver.org/stable/en/user/data/database/primarykey.html#using-the-metadata-table-with-views

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://www.geo-solutions.it

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://www.geo-solutions.it

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://www.geo-solutions.it

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.



Check out the vibrant tech community on one of the world’s most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot


Geoserver-devel mailing list
Geoserver-devel@anonymised.com.366…sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

==
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://www.geo-solutions.it
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.


On Wed, May 10, 2017 at 2:10 PM, Andrea Aime <andrea.aime@anonymised.com>
wrote:

I'd guess it was working by accident back then, and the "accident" got
solved
in the meantime. Hard to say what or why without more investigation

Btw, that's precisely why we are insisting on having tests today... all the
old code that was created
before we had this rules has few tests, and functionality may regress
without warning this way.
Adding tests is more work for sure, but what has an automatic tested stays
there...

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://www.geo-solutions.it
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.

-------------------------------------------------------