assertj-db icon indicating copy to clipboard operation
assertj-db copied to clipboard

QueryTimeout

Open fafafifi123 opened this issue 5 years ago • 3 comments

Is there a way to specify connection / query timeout while using assertj db ?

fafafifi123 avatar Aug 26 '19 04:08 fafafifi123

@willyhalim , Currently you have two ways to do that :

  1. You can use properties in JDBC connection URL with AssertJ-DB Source ( For example with Postgresl : https://jdbc.postgresql.org/documentation/head/connect.html )
  2. You can use settings of DataSource and use it in Table instead of Source

Tell me if it fit with your requirement.

VanRoy avatar Dec 06 '19 14:12 VanRoy

It seems didnt work , in normal prepared statement i can do something like this

 ps = conn.prepareStatement(query);
            if (queryTimeout > 0) {
                ps.setQueryTimeout(queryTimeout);
                LOGGER.info("set querytimeout {}", queryTimeout);
            }

fafafifi123 avatar Oct 29 '20 03:10 fafafifi123

Hi @willyhalim , can you send me some details of your issue / use case ? When the timeout error is raised ? During the connection ? During an assertj-db assertion ? Thanks.

VanRoy avatar Nov 01 '20 20:11 VanRoy