I have included this line "Number of records inserted : "+((Integer)globalMap.get("tOracleOutput_3_NB_LINE_INSERTED"))" in the tSendMail component .
It gives wrong count in the email but the number of records inserted in the tables is correct.
It works fine in our staging environments but not in production.
I have turned on batch mode for the oracle output components to increase performance. not sure if thats causing the wrong count in email but we get correct count in staging environments.
In your job, where you are using this expression ? Like post tOracleOutput_3 completion or on sub job completion & when you are claling tSendMail? We need to see flow to advice your further.. it could be because of many reason.
Also compare to staging, your target table already have data in prod? How you are counting the records and making sure its inserted by your tOracleOutput3 and not by any other process? There will be some uniqueness right?
Yes i am using a shared connection and when we toracleoutput the records are auto committed we dont have to explicitly define commit in that component.
the actual number is around 200k but in the email i get around 1000 .
OK, I *think* this might be caused by the latency of the automatic commit. Can you try adding a commit component before the email component is fired? If that doesn't work, try setting the tOracleOutput component to have its own connection. I am sure that will work.
When a DB component has its own connection, it will commit while it is processing automatically. Once the component has finished, the commits have happened. So when you call on the count record in a later subjob, the total is correct. I have seen issues like this before.