[Geoserver-users] Oracle WFS Insert Problem

Hi all,

I'm trying to insert a record into an Oracle table using wfs.

Example:

<wfs:Transaction xmlns:wfs="http://www.opengis.net/wfs&quot; version="1.0.0"
service="WFS" xmlns:cadrede_gis="http://www.xlm.pt/cadrede_gis&quot;
xmlns:gml="http://www.opengis.net/gml&quot;
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance&quot;
xsi:schemaLocation="http://www.opengis.net/wfs
http://schemas.opengis.net/wfs/1.0.0/WFS-transaction.xsd
http://www.xlm.pt/cadrede_gis
http://10.112.80.28:8086/Geoserver/wfs/DescribeFeatureType?typename=RO_ABC&quot;&gt;
   <wfs:Insert >
     <cadrede_gis:RO_ABC>
         <cadrede_gis:LOCATION>
           <gml:Point>
             <gml:coordinates decimal="." cs="," ts=" ">
              229065.6464055808,1650741.262621733
             </gml:coordinates>
           </gml:Point>
       </cadrede_gis:LOCATION>
       <cadrede_gis:ID_EF>179</cadrede_gis:ID_EF>
     </cadrede_gis:RO_ABC>
   </wfs:Insert>
</wfs:Transaction>

It's a simple table with 2 columms: ID_EF (PK and FK) and LOCATION

The Insert into the DB is ok, but the value of ID_EF is incremented. In the
request the value for id_ef is 179 but at table shows other value (example:
4 if the higher value was 3, or 5 if it was 4). I don't wave a sequence to
that field.

Is Geoserver incrementing my id?

I know there were some issues about primary keys, there's already a
solution? to use pk as attibute?

Thanks in advance,

Nunes

--
View this message in context: http://www.nabble.com/Oracle-WFS-Insert-Problem-tp25531091p25531091.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

Hi,

If there is a sequence for a table (name: TABLE) named exactly as
TABLE_SEQUENCE then the new fid is taken from the sequnce. Otherwise
Geoserver makes a query to get max(fid) and uses (max(fid)+1) in insert.
At least this is how I have understood it.

I believe that it is better to take it as it is and use sequence and
trigger for all the tables if the meaning is to send inserts to them
through WFS.

-Jukka Rahkonen-

D.Nunes wrote:

Hi all,

I'm trying to insert a record into an Oracle table using wfs.

Example:

<wfs:Transaction xmlns:wfs="http://www.opengis.net/wfs&quot;
version="1.0.0"
service="WFS" xmlns:cadrede_gis="http://www.xlm.pt/cadrede_gis&quot;
xmlns:gml="http://www.opengis.net/gml&quot;
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance&quot;
xsi:schemaLocation="http://www.opengis.net/wfs
http://schemas.opengis.net/wfs/1.0.0/WFS-transaction.xsd
http://www.xlm.pt/cadrede_gis
http://10.112.80.28:8086/Geoserver/wfs/DescribeFeatureType?typ
ename=RO_ABC">
   <wfs:Insert >
     <cadrede_gis:RO_ABC>
         <cadrede_gis:LOCATION>
           <gml:Point>
             
<gml:coordinates decimal="." cs="," ts=" ">
              
229065.6464055808,1650741.262621733
             </gml:coordinates>
           </gml:Point>
       </cadrede_gis:LOCATION>
       <cadrede_gis:ID_EF>179</cadrede_gis:ID_EF>
     </cadrede_gis:RO_ABC>
   </wfs:Insert>
</wfs:Transaction>

It's a simple table with 2 columms: ID_EF (PK and FK) and LOCATION

The Insert into the DB is ok, but the value of ID_EF is
incremented. In the request the value for id_ef is 179 but at
table shows other value (example:
4 if the higher value was 3, or 5 if it was 4). I don't wave
a sequence to that field.

Is Geoserver incrementing my id?

I know there were some issues about primary keys, there's
already a solution? to use pk as attibute?

Thanks in advance,

Nunes

--
View this message in context:
http://www.nabble.com/Oracle-WFS-Insert-Problem-tp25531091p255
31091.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

--------------------------------------------------------------
----------------
Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
is the only developer event you need to attend this year.
Jumpstart your
developing skills, take BlackBerry mobile applications to
market and stay
ahead of the curve. Join us from November 9&#45;12, 2009.
Register now&#33;
http://p.sf.net/sfu/devconf
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users