etltalenddata-integration

Unable to use both SQL Server and Postgres connection together on the same job - Talend


For a test, I created this simple Talend job:

enter image description here

The tRowGenerator generates a row with int column and is staged to temporary database in Postgres.

enter image description here

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

enter image description here

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?


Solution

  • 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

    enter image description here

    Once I gave them a different name, it now works irrespective of who is configured first on the tPrejob