Skip to main content
Solved

Using FeatureReader after FeatureWriter

  • June 1, 2023
  • 6 replies
  • 34 views

scootercat_nl
Contributor
Forum|alt.badge.img+5

I have made a script that writes data to Oracle database, using FeatureWriter.

Before I write data, I use FeatureReader to read number of records.

 

At the end of the script I want to know how many records there are now.

I also use FeatureReader for this.

 

The results are always the same as before and after the transactions.

 

It seems that the 2nd FeatureReader has already started before the transactions have been processed.

 

I have tried with Oracle Reader, 2nd connection parameter, SQLExecutor.

The results are always the same as before and after the transactions.

Also using Triggerer and Decelarator.

 

Something has to happen that the 2nd FeatureReader will 're-read' the table.

 

Anyone has a suggestion ?

 

Thank you in advance !

 

Best answer by ebygomm

ExampleWriteRead 

Maybe my description wasn't very clear. I have made an image for clarification.

Hopefully you can help me further.

 

Thanks for your patience

 

Replace your writer with a featurewriter, choose One per Feature Type for your output ports and then use that output to continue the flow

image

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

6 replies

nielsgerrits
VIP
Forum|alt.badge.img+60
  • 2938 replies
  • June 1, 2023

How do you initiate the second featurereader? It should be initiated by the featurewriters summary feature to make sure it starts after the writing is done.

 

Also, if you have featurecaching on, nothing changes for each run. Try to switch it off.


scootercat_nl
Contributor
Forum|alt.badge.img+5
  • Author
  • Contributor
  • 19 replies
  • June 1, 2023

How do you initiate the second featurereader? It should be initiated by the featurewriters summary feature to make sure it starts after the writing is done.

 

Also, if you have featurecaching on, nothing changes for each run. Try to switch it off.

Hi Niels.

 

featurereader Oracle (count number of records) -> feature reader CSV/ZIP -> AttributeManager (fme_db_operation). Hereafter 2 lines : Route 1. FeatureWriter (Oracle) Route 2. Other Transformers.

 

A little further down the Route 2 I start FeatureReader to read out the number of records.

(after Triggerer and Decelarator)

 

I let the entire process run in the background (via task scheduler). Does cache affect this?

 


nielsgerrits
VIP
Forum|alt.badge.img+60
  • 2938 replies
  • June 1, 2023

I believe fetaurecaching is off in batch mode.

 

But you can't place the reader in route 2 and be sure the reading is done before the writing. The reading need to be done downstream of the FeatureWriter. A trick to be sure the order is correct, is to feed the features from the AttributeManager and the outputfeature to a FeatureHolder, then use a Tester to remove the summary feature from the FeatureWriter from the stream, and do the things you want in route 2.


scootercat_nl
Contributor
Forum|alt.badge.img+5
  • Author
  • Contributor
  • 19 replies
  • June 1, 2023

I believe fetaurecaching is off in batch mode.

 

But you can't place the reader in route 2 and be sure the reading is done before the writing. The reading need to be done downstream of the FeatureWriter. A trick to be sure the order is correct, is to feed the features from the AttributeManager and the outputfeature to a FeatureHolder, then use a Tester to remove the summary feature from the FeatureWriter from the stream, and do the things you want in route 2.

ExampleWriteRead 

Maybe my description wasn't very clear. I have made an image for clarification.

Hopefully you can help me further.

 

Thanks for your patience

 


ebygomm
Influencer
Forum|alt.badge.img+44
  • Influencer
  • 3427 replies
  • Best Answer
  • June 1, 2023

ExampleWriteRead 

Maybe my description wasn't very clear. I have made an image for clarification.

Hopefully you can help me further.

 

Thanks for your patience

 

Replace your writer with a featurewriter, choose One per Feature Type for your output ports and then use that output to continue the flow

image


scootercat_nl
Contributor
Forum|alt.badge.img+5
  • Author
  • Contributor
  • 19 replies
  • June 6, 2023

ExampleWriteRead 

Maybe my description wasn't very clear. I have made an image for clarification.

Hopefully you can help me further.

 

Thanks for your patience

 

thanks for your comment. Combined with your answer I got results I wanted.