Skip to main content
Announcements
SYSTEM MAINTENANCE: Thurs., Sept. 19, 1 AM ET, Platform will be unavailable for approx. 60 minutes.
cancel
Showing results for 
Search instead for 
Did you mean: 
rohsuh
Contributor
Contributor

How can you get data from one tDBConnection and pass it to tDBRow using a different connection?

Hi,

I am unable to pass or retain data from one tDBConnection to a tDBRow referencing another tDBConnection.

I have tried using Job Context variables and tSetGlobalVar to create a global variable. However, in both cases, I am unable to pass the values between two tDBRow components referencing two separate tDBConnections.

 

Job design is as follows

 

tDBConnection_1(C1) -> tDBConnection_2(C2)

->OnSubjobOk->

tDBInput(Postgresql) (C1)-> tSetGlobalVar->tJavaRow(set context variable)

->OnSubjobOk->

tDBInput(Postgresql) (C1)-> tMap -> tDBOutput (Postgresql) (multiple)

->OnSubjobOk->

tJava( Debug &Print statements) ->tDBCommit(C2) (Some tables (different DB schema) are updated as a result of updating via C1. However we cannot commit the changes in those tables via C1 but have to use C2 instead)

-> OnSubJobOk ->

tDBRow (Postgresql) Update # 1

(C1)

-> OnSubJobOk->

tJava ( Debug &Print statements)

-> OnSubJobOk ->

tDBRow (Postgresql) Update # 2 

(C1)

-> OnSubJobOk ->

tJava ( Debug &Print statements)

-> OnSubJobOk ->

tDBRow (Postgresql) Update # 3

(C1)

-> OnSubJobOk ->

tJava ( Debug &Print statements)

-> OnSubJobOk ->

tDBRow (Postgresql) Update # 4

(C1)

-> OnSubJobOk ->

tDBCommit_1 (Postgresql)

(C1)

-> tDBCommit_2 (Postgresql)

(C2)

Can you please recommend a better way to be able to pass data into variables between two DB Connections and and not have data set to NULL when committing between connections?

Thanks very much

Kind regards

Labels (4)
4 Replies
rohsuh
Contributor
Contributor
Author

@Shicong Hong​ @Xuan Junior​  This is a follow up question to https://community.talend.com/s/feed/0D55b00006LvmWyCAJ?language=en_US. Can you please assist?

 

Thanks

XJ_1630
Contributor III
Contributor III

I would recommend to contact a person with more experience to look into these complicated jobs.

 

🍻

rohsuh
Contributor
Contributor
Author

@Xuan Junior​ Thanks for your response. I have been stuck with this problem for a while. It would help if someone more experienced could help.

rohsuh
Contributor
Contributor
Author

@Xuan Junior​ I have switched to using tJDBCxxxxx components so there is no issues with different connections to same DB. This seems to have solved the issue for me