query timeout not working in JDBC or SQL component

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

query timeout not working in JDBC or SQL component

Gv, Shivakumar
Hi Team,

I am using camel version: 2.23.1

Query timeout not working in both JDBC or SQL component.

for jdbc: i tried passing timeout value a  jdbc:dataSource?statement.queryTimeout=1&statement.maxRows=0



for sql:

i tried passing timeout value a  sql:quey?template.queryTimeout=1



but if i set the socket timeout (defaultQueryTimeout) value in basic data source that works.but individual Statement query timeout is not working.

please help me with this issue.



Thanks,

Shiva

________________________________
NOTICE: All information in and attached to the e-mails below may be proprietary, confidential, privileged and otherwise protected from improper or erroneous disclosure. If you are not the sender's intended recipient, you are not authorized to intercept, read, print, retain, copy, forward, or disseminate this message. If you have erroneously received this communication, please notify the sender immediately by phone (704-758-1000) or by e-mail and destroy all copies of this message electronic, paper, or otherwise. By transmitting documents via this email: Users, Customers, Suppliers and Vendors collectively acknowledge and agree the transmittal of information via email is voluntary, is offered as a convenience, and is not a secured method of communication; Not to transmit any payment information E.G. credit card, debit card, checking account, wire transfer information, passwords, or sensitive and personal information E.G. Driver's license, DOB, social security, or any other information the user wishes to remain confidential; To transmit only non-confidential information such as plans, pictures and drawings and to assume all risk and liability for and indemnify Lowe's from any claims, losses or damages that may arise from the transmittal of documents or including non-confidential information in the body of an email transmittal. Thank you.
Reply | Threaded
Open this post in threaded view
|

Re: query timeout not working in JDBC or SQL component

Claus Ibsen-2
Hi

A socket timeout and a query timeout are likely not the same. Socket
is network level. Query is likely on the database level.

On Tue, Jan 14, 2020 at 4:00 PM Gv, Shivakumar <[hidden email]> wrote:

>
> Hi Team,
>
> I am using camel version: 2.23.1
>
> Query timeout not working in both JDBC or SQL component.
>
> for jdbc: i tried passing timeout value a  jdbc:dataSource?statement.queryTimeout=1&statement.maxRows=0
>
>
>
> for sql:
>
> i tried passing timeout value a  sql:quey?template.queryTimeout=1
>
>
>
> but if i set the socket timeout (defaultQueryTimeout) value in basic data source that works.but individual Statement query timeout is not working.
>
> please help me with this issue.
>
>
>
> Thanks,
>
> Shiva
>
> ________________________________
> NOTICE: All information in and attached to the e-mails below may be proprietary, confidential, privileged and otherwise protected from improper or erroneous disclosure. If you are not the sender's intended recipient, you are not authorized to intercept, read, print, retain, copy, forward, or disseminate this message. If you have erroneously received this communication, please notify the sender immediately by phone (704-758-1000) or by e-mail and destroy all copies of this message electronic, paper, or otherwise. By transmitting documents via this email: Users, Customers, Suppliers and Vendors collectively acknowledge and agree the transmittal of information via email is voluntary, is offered as a convenience, and is not a secured method of communication; Not to transmit any payment information E.G. credit card, debit card, checking account, wire transfer information, passwords, or sensitive and personal information E.G. Driver's license, DOB, social security, or any other information the user wishes to remain confidential; To transmit only non-confidential information such as plans, pictures and drawings and to assume all risk and liability for and indemnify Lowe's from any claims, losses or damages that may arise from the transmittal of documents or including non-confidential information in the body of an email transmittal. Thank you.



--
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2
Reply | Threaded
Open this post in threaded view
|

RE: [EXTERNAL] Re: query timeout not working in JDBC or SQL component

Gv, Shivakumar
Hi Claus,

Thanks for the reply. Yes I agree with your point . I just mentioned my observation that socket timeout is working.

But my requirement is to set  queryTimeout  and both the below methods did not work.

for jdbc: i tried passing timeout value a
> jdbc:dataSource?statement.queryTimeout=1&statement.maxRows=0
> for sql: I tried passing timeout value a  sql:quey?template.queryTimeout=1

Thanks,
Shiva

-----Original Message-----
From: Claus Ibsen <[hidden email]>
Sent: Tuesday, January 14, 2020 8:49 PM
To: [hidden email]
Subject: [EXTERNAL] Re: query timeout not working in JDBC or SQL component

*EXTERNAL SENDER*


Hi

A socket timeout and a query timeout are likely not the same. Socket is network level. Query is likely on the database level.

On Tue, Jan 14, 2020 at 4:00 PM Gv, Shivakumar <[hidden email]> wrote:

>
> Hi Team,
>
> I am using camel version: 2.23.1
>
> Query timeout not working in both JDBC or SQL component.
>
> for jdbc: i tried passing timeout value a
> jdbc:dataSource?statement.queryTimeout=1&statement.maxRows=0
>
>
>
> for sql:
>
> i tried passing timeout value a  sql:quey?template.queryTimeout=1
>
>
>
> but if i set the socket timeout (defaultQueryTimeout) value in basic data source that works.but individual Statement query timeout is not working.
>
> please help me with this issue.
>
>
>
> Thanks,
>
> Shiva
>
> ________________________________
> NOTICE: All information in and attached to the e-mails below may be proprietary, confidential, privileged and otherwise protected from improper or erroneous disclosure. If you are not the sender's intended recipient, you are not authorized to intercept, read, print, retain, copy, forward, or disseminate this message. If you have erroneously received this communication, please notify the sender immediately by phone (704-758-1000) or by e-mail and destroy all copies of this message electronic, paper, or otherwise. By transmitting documents via this email: Users, Customers, Suppliers and Vendors collectively acknowledge and agree the transmittal of information via email is voluntary, is offered as a convenience, and is not a secured method of communication; Not to transmit any payment information E.G. credit card, debit card, checking account, wire transfer information, passwords, or sensitive and personal information E.G. Driver's license, DOB, social security, or any other information the user wishes to remain confidential; To transmit only non-confidential information such as plans, pictures and drawings and to assume all risk and liability for and indemnify Lowe's from any claims, losses or damages that may arise from the transmittal of documents or including non-confidential information in the body of an email transmittal. Thank you.



--
Claus Ibsen
-----------------
https://nam03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fdavsclaus.com&amp;data=02%7C01%7Cshivakumar.gv%40lowes.com%7C340f921324a4438cd83208d79905167f%7Cbcfa3e87841e48c7983b584159dd1a69%7C0%7C1%7C637146119445022333&amp;sdata=GB09J5qYIIbuqvzggvgBxJdb3L1ZrjQA6G1TWoucRyk%3D&amp;reserved=0 @davsclaus Camel in Action 2: https://nam03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.manning.com%2Fibsen2&amp;data=02%7C01%7Cshivakumar.gv%40lowes.com%7C340f921324a4438cd83208d79905167f%7Cbcfa3e87841e48c7983b584159dd1a69%7C0%7C1%7C637146119445032331&amp;sdata=%2FGkV1aUJWxQcy0WrMY2W9YPT%2FO8vqDMWzZGhjjhMdes%3D&amp;reserved=0
________________________________
NOTICE: All information in and attached to the e-mails below may be proprietary, confidential, privileged and otherwise protected from improper or erroneous disclosure. If you are not the sender's intended recipient, you are not authorized to intercept, read, print, retain, copy, forward, or disseminate this message. If you have erroneously received this communication, please notify the sender immediately by phone (704-758-1000) or by e-mail and destroy all copies of this message electronic, paper, or otherwise. By transmitting documents via this email: Users, Customers, Suppliers and Vendors collectively acknowledge and agree the transmittal of information via email is voluntary, is offered as a convenience, and is not a secured method of communication; Not to transmit any payment information E.G. credit card, debit card, checking account, wire transfer information, passwords, or sensitive and personal information E.G. Driver's license, DOB, social security, or any other information the user wishes to remain confidential; To transmit only non-confidential information such as plans, pictures and drawings and to assume all risk and liability for and indemnify Lowe's from any claims, losses or damages that may arise from the transmittal of documents or including non-confidential information in the body of an email transmittal. Thank you.
Reply | Threaded
Open this post in threaded view
|

Re: [EXTERNAL] Re: query timeout not working in JDBC or SQL component

Claus Ibsen-2
Hi

Debug the code and see if the queryTimeout is set on the JDBC
statement - that is after all what Camel does.
Whether and how the timeout works is the JDBC driver.


On Tue, Jan 14, 2020 at 4:27 PM Gv, Shivakumar <[hidden email]> wrote:

>
> Hi Claus,
>
> Thanks for the reply. Yes I agree with your point . I just mentioned my observation that socket timeout is working.
>
> But my requirement is to set  queryTimeout  and both the below methods did not work.
>
> for jdbc: i tried passing timeout value a
> > jdbc:dataSource?statement.queryTimeout=1&statement.maxRows=0
> > for sql: I tried passing timeout value a  sql:quey?template.queryTimeout=1
>
> Thanks,
> Shiva
>
> -----Original Message-----
> From: Claus Ibsen <[hidden email]>
> Sent: Tuesday, January 14, 2020 8:49 PM
> To: [hidden email]
> Subject: [EXTERNAL] Re: query timeout not working in JDBC or SQL component
>
> *EXTERNAL SENDER*
>
>
> Hi
>
> A socket timeout and a query timeout are likely not the same. Socket is network level. Query is likely on the database level.
>
> On Tue, Jan 14, 2020 at 4:00 PM Gv, Shivakumar <[hidden email]> wrote:
> >
> > Hi Team,
> >
> > I am using camel version: 2.23.1
> >
> > Query timeout not working in both JDBC or SQL component.
> >
> > for jdbc: i tried passing timeout value a
> > jdbc:dataSource?statement.queryTimeout=1&statement.maxRows=0
> >
> >
> >
> > for sql:
> >
> > i tried passing timeout value a  sql:quey?template.queryTimeout=1
> >
> >
> >
> > but if i set the socket timeout (defaultQueryTimeout) value in basic data source that works.but individual Statement query timeout is not working.
> >
> > please help me with this issue.
> >
> >
> >
> > Thanks,
> >
> > Shiva
> >
> > ________________________________
> > NOTICE: All information in and attached to the e-mails below may be proprietary, confidential, privileged and otherwise protected from improper or erroneous disclosure. If you are not the sender's intended recipient, you are not authorized to intercept, read, print, retain, copy, forward, or disseminate this message. If you have erroneously received this communication, please notify the sender immediately by phone (704-758-1000) or by e-mail and destroy all copies of this message electronic, paper, or otherwise. By transmitting documents via this email: Users, Customers, Suppliers and Vendors collectively acknowledge and agree the transmittal of information via email is voluntary, is offered as a convenience, and is not a secured method of communication; Not to transmit any payment information E.G. credit card, debit card, checking account, wire transfer information, passwords, or sensitive and personal information E.G. Driver's license, DOB, social security, or any other information the user wishes to remain confidential; To transmit only non-confidential information such as plans, pictures and drawings and to assume all risk and liability for and indemnify Lowe's from any claims, losses or damages that may arise from the transmittal of documents or including non-confidential information in the body of an email transmittal. Thank you.
>
>
>
> --
> Claus Ibsen
> -----------------
> https://nam03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fdavsclaus.com&amp;data=02%7C01%7Cshivakumar.gv%40lowes.com%7C340f921324a4438cd83208d79905167f%7Cbcfa3e87841e48c7983b584159dd1a69%7C0%7C1%7C637146119445022333&amp;sdata=GB09J5qYIIbuqvzggvgBxJdb3L1ZrjQA6G1TWoucRyk%3D&amp;reserved=0 @davsclaus Camel in Action 2: https://nam03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.manning.com%2Fibsen2&amp;data=02%7C01%7Cshivakumar.gv%40lowes.com%7C340f921324a4438cd83208d79905167f%7Cbcfa3e87841e48c7983b584159dd1a69%7C0%7C1%7C637146119445032331&amp;sdata=%2FGkV1aUJWxQcy0WrMY2W9YPT%2FO8vqDMWzZGhjjhMdes%3D&amp;reserved=0
> ________________________________
> NOTICE: All information in and attached to the e-mails below may be proprietary, confidential, privileged and otherwise protected from improper or erroneous disclosure. If you are not the sender's intended recipient, you are not authorized to intercept, read, print, retain, copy, forward, or disseminate this message. If you have erroneously received this communication, please notify the sender immediately by phone (704-758-1000) or by e-mail and destroy all copies of this message electronic, paper, or otherwise. By transmitting documents via this email: Users, Customers, Suppliers and Vendors collectively acknowledge and agree the transmittal of information via email is voluntary, is offered as a convenience, and is not a secured method of communication; Not to transmit any payment information E.G. credit card, debit card, checking account, wire transfer information, passwords, or sensitive and personal information E.G. Driver's license, DOB, social security, or any other information the user wishes to remain confidential; To transmit only non-confidential information such as plans, pictures and drawings and to assume all risk and liability for and indemnify Lowe's from any claims, losses or damages that may arise from the transmittal of documents or including non-confidential information in the body of an email transmittal. Thank you.



--
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2
Reply | Threaded
Open this post in threaded view
|

RE: [EXTERNAL] Re: query timeout not working in JDBC or SQL component

Gv, Shivakumar
Hi ,

queryTimeout  is set on the statement correctly. It worked for me on SQL , Terradata , Oracle DB  except for DB2 data base .As you mentioned the DB2 jdbc driver might not be recognizing  this setting.

[TRACE]: org.apache.camel.util.IntrospectionSupport - Configured property: queryTimeout on bean: com.ibm.db2.jcc.am.no@1c5e9bda with value: 1
[TRACE]: org.apache.camel.util.IntrospectionSupport - Configured property: maxRows on bean: com.ibm.db2.jcc.am.no@1c5e9bda with value: 100
[DEBUG]: org.apache.camel.component.jdbc.JdbcProducer - Executing JDBC Statement: select * from  ABCD.T5700_AST_PUR_HST

Thanks,
Shiva

-----Original Message-----
From: Claus Ibsen <[hidden email]>
Sent: Tuesday, January 14, 2020 9:02 PM
To: [hidden email]
Subject: Re: [EXTERNAL] Re: query timeout not working in JDBC or SQL component

*EXTERNAL SENDER*


Hi

Debug the code and see if the queryTimeout is set on the JDBC statement - that is after all what Camel does.
Whether and how the timeout works is the JDBC driver.


On Tue, Jan 14, 2020 at 4:27 PM Gv, Shivakumar <[hidden email]> wrote:

>
> Hi Claus,
>
> Thanks for the reply. Yes I agree with your point . I just mentioned my observation that socket timeout is working.
>
> But my requirement is to set  queryTimeout  and both the below methods did not work.
>
> for jdbc: i tried passing timeout value a
> > jdbc:dataSource?statement.queryTimeout=1&statement.maxRows=0
> > for sql: I tried passing timeout value a
> > sql:quey?template.queryTimeout=1
>
> Thanks,
> Shiva
>
> -----Original Message-----
> From: Claus Ibsen <[hidden email]>
> Sent: Tuesday, January 14, 2020 8:49 PM
> To: [hidden email]
> Subject: [EXTERNAL] Re: query timeout not working in JDBC or SQL
> component
>
> *EXTERNAL SENDER*
>
>
> Hi
>
> A socket timeout and a query timeout are likely not the same. Socket is network level. Query is likely on the database level.
>
> On Tue, Jan 14, 2020 at 4:00 PM Gv, Shivakumar <[hidden email]> wrote:
> >
> > Hi Team,
> >
> > I am using camel version: 2.23.1
> >
> > Query timeout not working in both JDBC or SQL component.
> >
> > for jdbc: i tried passing timeout value a
> > jdbc:dataSource?statement.queryTimeout=1&statement.maxRows=0
> >
> >
> >
> > for sql:
> >
> > i tried passing timeout value a  sql:quey?template.queryTimeout=1
> >
> >
> >
> > but if i set the socket timeout (defaultQueryTimeout) value in basic data source that works.but individual Statement query timeout is not working.
> >
> > please help me with this issue.
> >
> >
> >
> > Thanks,
> >
> > Shiva
> >
> > ________________________________
> > NOTICE: All information in and attached to the e-mails below may be proprietary, confidential, privileged and otherwise protected from improper or erroneous disclosure. If you are not the sender's intended recipient, you are not authorized to intercept, read, print, retain, copy, forward, or disseminate this message. If you have erroneously received this communication, please notify the sender immediately by phone (704-758-1000) or by e-mail and destroy all copies of this message electronic, paper, or otherwise. By transmitting documents via this email: Users, Customers, Suppliers and Vendors collectively acknowledge and agree the transmittal of information via email is voluntary, is offered as a convenience, and is not a secured method of communication; Not to transmit any payment information E.G. credit card, debit card, checking account, wire transfer information, passwords, or sensitive and personal information E.G. Driver's license, DOB, social security, or any other information the user wishes to remain confidential; To transmit only non-confidential information such as plans, pictures and drawings and to assume all risk and liability for and indemnify Lowe's from any claims, losses or damages that may arise from the transmittal of documents or including non-confidential information in the body of an email transmittal. Thank you.
>
>
>
> --
> Claus Ibsen
> -----------------
> https://nam03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fdavsc
> laus.com&amp;data=02%7C01%7Cshivakumar.gv%40lowes.com%7C709f1a140abf44
> 4740c308d799072398%7Cbcfa3e87841e48c7983b584159dd1a69%7C0%7C0%7C637146
> 128252052518&amp;sdata=97HvZLBmgew5k3MmiOV5MpxTcclWQSMJYzybVdcA%2BfA%3
> D&amp;reserved=0 @davsclaus Camel in Action 2:
> https://nam03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.
> manning.com%2Fibsen2&amp;data=02%7C01%7Cshivakumar.gv%40lowes.com%7C70
> 9f1a140abf444740c308d799072398%7Cbcfa3e87841e48c7983b584159dd1a69%7C0%
> 7C0%7C637146128252052518&amp;sdata=mW0xq%2B1ErKDQ17nKPQm1WjgygBwWGq%2B
> ND8UoPYZ94KI%3D&amp;reserved=0
> ________________________________
> NOTICE: All information in and attached to the e-mails below may be proprietary, confidential, privileged and otherwise protected from improper or erroneous disclosure. If you are not the sender's intended recipient, you are not authorized to intercept, read, print, retain, copy, forward, or disseminate this message. If you have erroneously received this communication, please notify the sender immediately by phone (704-758-1000) or by e-mail and destroy all copies of this message electronic, paper, or otherwise. By transmitting documents via this email: Users, Customers, Suppliers and Vendors collectively acknowledge and agree the transmittal of information via email is voluntary, is offered as a convenience, and is not a secured method of communication; Not to transmit any payment information E.G. credit card, debit card, checking account, wire transfer information, passwords, or sensitive and personal information E.G. Driver's license, DOB, social security, or any other information the user wishes to remain confidential; To transmit only non-confidential information such as plans, pictures and drawings and to assume all risk and liability for and indemnify Lowe's from any claims, losses or damages that may arise from the transmittal of documents or including non-confidential information in the body of an email transmittal. Thank you.



--
Claus Ibsen
-----------------
https://nam03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fdavsclaus.com&amp;data=02%7C01%7Cshivakumar.gv%40lowes.com%7C709f1a140abf444740c308d799072398%7Cbcfa3e87841e48c7983b584159dd1a69%7C0%7C0%7C637146128252062517&amp;sdata=i1xWuPJWp95i4Erg76OwEB%2BiDlfV8%2FD%2FaAZVYHZb2jk%3D&amp;reserved=0 @davsclaus Camel in Action 2: https://nam03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.manning.com%2Fibsen2&amp;data=02%7C01%7Cshivakumar.gv%40lowes.com%7C709f1a140abf444740c308d799072398%7Cbcfa3e87841e48c7983b584159dd1a69%7C0%7C0%7C637146128252062517&amp;sdata=p35c9szYDaoQ7Mc7xhXhkBw6nahSYopWRP9%2Bp9zlIEQ%3D&amp;reserved=0
________________________________
NOTICE: All information in and attached to the e-mails below may be proprietary, confidential, privileged and otherwise protected from improper or erroneous disclosure. If you are not the sender's intended recipient, you are not authorized to intercept, read, print, retain, copy, forward, or disseminate this message. If you have erroneously received this communication, please notify the sender immediately by phone (704-758-1000) or by e-mail and destroy all copies of this message electronic, paper, or otherwise. By transmitting documents via this email: Users, Customers, Suppliers and Vendors collectively acknowledge and agree the transmittal of information via email is voluntary, is offered as a convenience, and is not a secured method of communication; Not to transmit any payment information E.G. credit card, debit card, checking account, wire transfer information, passwords, or sensitive and personal information E.G. Driver's license, DOB, social security, or any other information the user wishes to remain confidential; To transmit only non-confidential information such as plans, pictures and drawings and to assume all risk and liability for and indemnify Lowe's from any claims, losses or damages that may arise from the transmittal of documents or including non-confidential information in the body of an email transmittal. Thank you.