Query retry on deadlock in JDBC

Connectivity
Enthusiast

Query retry on deadlock in JDBC

Hello,

I have gone through JDBC documentation, but I have not found a property or any other way, how to tell jdbc to retry a query that was aborted due to a deadlock.

We are running a lot of concurrent jobs and we get sometimes a deadlock - not because of actual deadlock, but because of lock table being full on an AMP.

Is there a way how to set JDBC to retry the failed query without aborting?

Thanks GLHF,

Yuri

2 REPLIES
Teradata Employee

Re: Query retry on deadlock in JDBC

Regarding the aborting...

When you receive Error 2631 "Transaction ABORTed due to deadlock", that is an error from the Teradata Database, and it indicates that the Teradata Database has aborted your transaction. The Teradata Database choosing to abort a transaction is outside the control of the Teradata JDBC Driver.

Regarding automatic retry...

No, the Teradata JDBC Driver does not provide any feature to retry a query. That is the responsibility of your application.

Please keep in mind that a transaction may consist of many SQL requests. It would be incorrect for the Teradata JDBC Driver to simply retry the most recent SQL request.

Enthusiast

Re: Query retry on deadlock in JDBC

Hello Tomnolan,

Thanks for the answer.