For a test, I created this simple Talend job:
The tRowGenerator
generates a row with int column and is staged to temporary database in Postgres.
The issue occurs whenever I run the job. The tDBOutput
component thinks it uses the SQL Server connection, but I know it uses the PostgreSQL database connection.
java.sql.SQLException: Column, parameter, or variable #1: Cannot find data type INT4
If I swap the SQL Server initialization to the end of the pre-job, the job runs successfully.
However, if I add an SQL Server tDBInput
or tDBOutput
component and PostgreSQL happens to be initialized at the start of the tPreJob
, they are considered as if they are using the PostgreSQL connection.
What am I missing here?
I have found the issue.
For the sake of a transaction, I have turned on Use or register of a shared DB connection
for both SQL server and Postgres. Both were using the same shared DB connection name
Once I gave them a different name, it now works irrespective of who is configured first on the tPrejob