Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How to use tdbconnection ,when we have multiple input DB components from the same tdbconnection

I am using TOS 7.1.* and wanted to automate the talend jobs using either task scheduler or Crontab .

 

I have a job which uses oracle tdbconnection ("Use an existing connection" option checked in tdbinput)

 

When i build the job and schedule it in task scheduler the execution fails, throwing error at the tdbinput (java.lang.NullPointerexception) this is because their is no connection between the tdbconnection and input components.

 

The above issue is resolved when i create a subjobok link between tdbconnection and tdbinput_1

 

But what to be done if I have more than one tdbinput components in the job ,as onsubjobok failed to connect to second tdbinput.

 

Since there is no link between the tdbconnection and tdbinput_2 the job in task scheduler fails complaining on tdbinput_2.

 

Is there any workaround or alternative to have tdbconnection to all tdbinput's in the JOB.

 

0683p000009M6ak.png0683p000009M6cp.png

Labels (2)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Hi, This should not be an issue if you are connecting tDbConnection component with tPreJob. The design should be like below-

 

tPreJob---->tDbConnection

 

tDbInput_1--->..

|

tDbInput_2 --->

 

Thanks

View solution in original post

2 Replies
Anonymous
Not applicable
Author

Hi, This should not be an issue if you are connecting tDbConnection component with tPreJob. The design should be like below-

 

tPreJob---->tDbConnection

 

tDbInput_1--->..

|

tDbInput_2 --->

 

Thanks

lennelei
Creator III
Creator III

Hi,

 

@pabburi : your second picture shows an incorrect job. It has 2 components with green background: one being your db connection.

That means that you don't know which component will start first, and if the first to start is the dbinput, it will fail as the connection doesn't exist.

 

You have to tell Talend to first open the connection, then use it.

 

You can put your db connection just after a tPreJob component as suggested but I do not recommend that because if your connection fails, the job will still run and might produce unwanted result if you do something else than just reading data.

 

In my opinion, it's best to open the connection and connect the dbinput to it with an OnSubjobOk or OnComponentOk link :

Still in your second screenshot, simply add a OnSubjobOk from the dbconnection to the dbinput :

 

tdbconnection ==[OnSubjobOk]==> tdbinput

 

Regards