Four Stars

failed to close the connection in tDB2Output

hi team, the below is the error while connecting DB2 output. kinldy adivse.

 

Error log:-

failed to close the connection in tDB2Output_1 :[jcc][t4][10251][10308][4.11.77] java.sql.Connection.close() requested while a transaction is in progress on the connection.
The transaction remains active, and the connection cannot be closed. ERRORCODE=-4471, SQLSTATE=null

  • Data Integration
1 ACCEPTED SOLUTION

Accepted Solutions
Ten Stars

Re: failed to close the connection in tDB2Output

Don't use a row connection to tDB2Commit. Use OnComponentOK instead.

In more detail, Talend starts all of the components connected with row connections at the same time. You don't want to commit until your tDB2Output component has completely finished.
9 REPLIES
Five Stars

Re: failed to close the connection in tDB2Output

It seems connection was not established properly, what is the input connection??

Create a METADATA connection and  use this to connect DB-  Use an existing connection 

 

Regards,

Avinash

Four Stars

Re: failed to close the connection in tDB2Output

Thanks Avinash for response. 

 

the below is the error after your suggestion applied.

 

Exception in component tDB2Close_1

com.ibm.db2.jcc.am.SqlException: [jcc][t4][10251][10308][4.11.77] java.sql.Connection.close() requested while a transaction is in progress on the connection.

The transaction remains active, and the connection cannot be closed. ERRORCODE=-4471, SQLSTATE=null

      at com.ibm.db2.jcc.am.gd.a(gd.java:660)

      at com.ibm.db2.jcc.am.gd.a(gd.java:60)

      at com.ibm.db2.jcc.am.gd.a(gd.java:120)

      at com.ibm.db2.jcc.am.lb.u(lb.java:1238)

      at com.ibm.db2.jcc.am.lb.x(lb.java:1260)

      at com.ibm.db2.jcc.am.lb.v(lb.java:1246)

      at com.ibm.db2.jcc.am.lb.close(lb.java:1228)

      at poc_project.extcdmgcqualscoreload_0_1.EXTCDMGCQualScoreLoad.tDB2Close_1Process(EXTCDMGCQualScoreLoad.java:2108)

      at poc_project.extcdmgcqualscoreload_0_1.EXTCDMGCQualScoreLoad.tFileInputDelimited_1Process(EXTCDMGCQualScoreLoad.java:1991)

      at poc_project.extcdmgcqualscoreload_0_1.EXTCDMGCQualScoreLoad.tDB2Connection_1Process(EXTCDMGCQualScoreLoad.java:448)

      at poc_project.extcdmgcqualscoreload_0_1.EXTCDMGCQualScoreLoad.runJobInTOS(EXTCDMGCQualScoreLoad.java:2350)

      at poc_project.extcdmgcqualscoreload_0_1.EXTCDMGCQualScoreLoad.main(EXTCDMGCQualScoreLoad.java:2207)

Moderator

Re: failed to close the connection in tDB2Output

Hello,

What does your whole work flow look like? Could you please post your job design screenshots into forum?

Best regards

Sabrina

--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
Four Stars

Re: failed to close the connection in tDB2Output

the job design like

 

db2 connection -> file input delimied -> tMap ->Db2 output -> Db2 commit

 

the job reading the data from file and load into table

Four Stars

Re: failed to close the connection in tDB2Output

 
Ten Stars

Re: failed to close the connection in tDB2Output

Don't use a row connection to tDB2Commit. Use OnComponentOK instead.

In more detail, Talend starts all of the components connected with row connections at the same time. You don't want to commit until your tDB2Output component has completely finished.
Moderator

Re: failed to close the connection in tDB2Output

Hello,

If you want to use a Row > Main connection to link tDB2Commit to your Job, your data will be committed row by row.

In this case, do not select the Close connection check box or your connection will be closed before the end of your first row commit.

 

Please see a related scenario:TalendHelpCenter: Inserting data in mother/daughter tables (MySql DB as an example)

Best regards

Sabrina

 

--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
Five Stars

Re: failed to close the connection in tDB2Output

it looks your box not able to connect DB2 port, are you able to create a DSN??

Four Stars

Re: failed to close the connection in tDB2Output

Sorry for late reply.

It's worked "tDB2Commit. Use OnComponentOK"