Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5947973
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T17:02:28+00:00 2026-05-22T17:02:28+00:00

Using the GeoTools WFS-T plugin, I have created a new row, and after a

  • 0

Using the GeoTools WFS-T plugin, I have created a new row, and after a commit, I have a FeatureId whos .getId() returns an ugly string that looks something like this:

newmy_database:my_table.9223372036854775807

Aside from the fact that the word “new” at the beginning of “my_database” is a surprise, the number in no way reflects the primary key of the new row (which in this case is “23”). Fair enough, I thought this may be some internal numbering system. However, now I want a foreign key in another table to get the primary key of the new row in this one, and I’m not sure how to get the value from this FID. Some places suggest that you can use an FID in a query like this:

Filter filter = filterFactory.id(Collections.singleton(fid));
Query query = new Query(tableName, filter);
SimpleFeatureCollection features = simpleFeatureSource.getFeatures(query);

But this fails at parsing the FID, at the underscore of all places! That underscore was there when the row was created (I had to pass “my_database:my_table” as the table to add the row to).

I’m sure that either there is something wrong with the id, or I’m using it incorrectly somehow. Can anyone shed any light?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T17:02:28+00:00Added an answer on May 22, 2026 at 5:02 pm

    It appears as if a couple things are going wrong – and perhaps a bug report is needed.

    The FeatureId with “new” at the beginning is a temporary id; that should be replaced with the real result once commit has been called.

    There are a number of way to be aware of this:

    1) You can listen for a BatchFeatureEvent; this offers the information on “temp id” -> “wfs id”

    2) Internally this information is parsed from the Transaction Result returned from your WFS. The result is saved in the WFSTransactionState for you to access. This was before BatchFeatureEvent was invented.

    Transaction transaction = new transaction("insert");
    try {
         SimpleFeatureStore featureStore =
               (SimpleFeatureStore) wfs.getFeatureSource( typeName );
         featureStore.setTransaction( transaction );
         featureStore.addFeatures( DataUtilities.collection( feature ) );
    
         transaction.commit();
    
         // get the final feature id
         WFSTransactionState wfsts = (WFSTransactionState) transaction.getState(wfs);
    
         // In this example there is only one fid. Get it.
         String result = wfsts.getFids( typeName )[0];
    }
    finally {
         transaction.close();
    }         
    

    I have updated the documentation with the above example:

    • http://docs.geotools.org/latest/userguide/library/data/wfs.html
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using online interfaces to a version control system is a nice way to have
Using TortoiseSVN against VisualSVN I delete a source file that I should not have
Using android 2.3.3, I have a background Service which has a socket connection. There's
I am trying run geotools on the web and have been googling around how
Using the following as an example (with $db being a previously created database connection
Using SolrNet for querying & faceting. I have a combination of int, tdate and
Using report builder 3.0, I have a report that queries a cube. How do
Using Rails 3.2.0.rc2 and ruby 1.9.3p0 In app/views/requests/_form.html.erb I have the following code for
Using Entity Framework CodeFirst, how do I create a created datetime column that gets
Using restlet, I want to make a post to android's c2dm service. I have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.