Question

I am currently creating an ETL job in talend which is connecting to a PostgreSQL database and I ran into a connection error.

I have set up a db connection in my talend repository with all the connection details I need to connect to my postgreSQL database and saved as 'mydbconnection', which specific database schema specified.

I have used mydbconnection in tPostgreSQLOutput and tPostgreSQLInput and both worked perfectly. However, when I use that same connection from the repository in a tEltPostgreSQLOutput_1 it throws an error (see below).

  1. I have tried the following to resolve it:
    1. Check the connection details in repository and ran 'Test connection' and all was ok
    2. Made sure the user name has privileges over this task - all ok
    3. Checked the max number of sessions the user talend is connecting with can have - ok
    4. Checked the max number of sessions the database server is willing to accept - all ok
    5. Checked the database logs - no thing recorded (not even 'failed connection attempt')
    6. Checked the version of java on my machine - v7 is supported by latest talend.
    7. Searched the previous questions here!

... and have no idea where to go from here. Does anyone know of any other good lines of investigation to resolve this?

Error message:

Exception in component tELTPostgresqlOutput_1
org.postgresql.util.PSQLException: The connection attempt failed.
    at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:137)
    at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:66)
    at org.postgresql.jdbc2.AbstractJdbc2Connection.<init>(AbstractJdbc2Connection.java:124)
    at org.postgresql.jdbc3.AbstractJdbc3Connection.<init>(AbstractJdbc3Connection.java:30)
    at org.postgresql.jdbc3.Jdbc3Connection.<init>(Jdbc3Connection.java:24)
    at org.postgresql.Driver.makeConnection(Driver.java:386)
    at org.postgresql.Driver.connect(Driver.java:260)
    at java.sql.DriverManager.getConnection(Unknown Source)
    at java.sql.DriverManager.getConnection(Unknown Source)
    at zurich_segmentation_prod.is_300_customer_new_0_1.is_300_customer_new.tELTPostgresqlMap_1Process(is_300_customer_new.java:338)
    at zurich_segmentation_prod.is_300_customer_new_0_1.is_300_customer_new.runJobInTOS(is_300_customer_new.java:602)
    at zurich_segmentation_prod.is_300_customer_new_0_1.is_300_customer_new.main(is_300_customer_new.java:470)
Was it helpful?

Solution

for anyone who runs into this problem in the future.. i found a way around it. I added a tPostgreSQLConnection to my workspace, then ticked the option in my tELTPostgreSQLMap to 'use existing connection' this then seems to remain connected when the work flow reaches the tEltPostgreSQLOutput component. It's not pretty but it works. The more obvious way (the way i had initial done it) does not work. A bug has been added to Talend's JIRA for this exact scenario.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top