Skip to main content
Question

Dynamic Workspace: Wrong number of features written


dsign-world
Contributor
Forum|alt.badge.img+2

FME tells me that there was 1 feature written to the database, but it is not true. In my opinion that’s a bug because the statement is objectively wrong.

In this case the translation failed because of an error. No features were written to the database. No table was created. I guess FME counts the schema feature, although it is NOT written to the database.

Here’s a part of the log and the workspace is attached.

POSTGRES Writer: Fanout for feature type 'SQLCreator' failed to find feature type template 'schema_from_query'
POSTGRES writer: An error has occurred. Check the logfile above for details
Successfully closed POSTGRES database writer
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Feature output statistics for `POSTGRES' writer using keyword `POSTGRES_1':
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
                               Features Written
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
SQLCreator                                                                   1
==============================================================================
Total Features Written                                                       1
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Translation FAILED with 2 error(s) and 2 warning(s) (1 feature(s) output)
FME Session Duration: 3.4 seconds. (CPU: 0.2s user, 2.0s system)
END - ProcessID: 7120, peak process memory usage: 50976 kB, current process memory usage: 50976 kB
WARNING:  there is no transaction in progress
POSTGRES writer: An error has occurred. Check the logfile above for details
Program Terminating
Translation FAILED.

 

4 replies

redgeographics
Celebrity
Forum|alt.badge.img+48

Another thing that may be happening here is that when writing to databases, FME considers a feature as being written when it is handed off to the database. Whatever the database does with it afterwards is not being tracked by FME. 

In addition to that, only features handled by actual Writers are being counted, so FeatureWriter transformers are left out of those statistics (the same goes for Readers vs FeatureReader transformers)

I would like to plead for an overhaul of these statistics.


dsign-world
Contributor
Forum|alt.badge.img+2
  • Author
  • Contributor
  • March 26, 2025
redgeographics wrote:

Another thing that may be happening here is that when writing to databases, FME considers a feature as being written when it is handed off to the database. Whatever the database does with it afterwards is not being tracked by FME.

 

I don’t think that’s the case here. Usually FME would first create a table on the database (if it doesn’t exist alreay - which it does not in my case) and then insert rows into that table.

The table’s name should be `SQLCreator` because Table Name is set to `@Value(fme_feature_type)` and the `fme_feature_type` attribute contains the value `SQLCreator`. But there is no table called `SQLCreator` on the database.

If FME encountered an error inserting rows into the database, it would display an according error message. But in this case FME didn’t write anything to the database because of there was an error with the schema feature.


ebygomm
Influencer
Forum|alt.badge.img+31
  • Influencer
  • March 26, 2025
redgeographics wrote:

Another thing that may be happening here is that when writing to databases, FME considers a feature as being written when it is handed off to the database. Whatever the database does with it afterwards is not being tracked by FME. 

In addition to that, only features handled by actual Writers are being counted, so FeatureWriter transformers are left out of those statistics (the same goes for Readers vs FeatureReader transformers)

I would like to plead for an overhaul of these statistics.

Often interpreting log files is more of an art than a science

If the FME log file says it’s read 9 features and written 9 features how many now exist?

0!

(because they were actually deletes)


dsign-world
Contributor
Forum|alt.badge.img+2
  • Author
  • Contributor
  • March 27, 2025

So “Features written” in the log probably stands for “Features processed by the writer” rather than features that were actually written to the database. What happens with the features that were processed by the writer depends on the writer settings (whether it inserts or deletes records or whether it’s a schema feature or not etc.).


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings