-
Notifications
You must be signed in to change notification settings - Fork 66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
H2 inner insert is not counted when a select is around #199
Comments
Thank you @MelleD for having reported this. The new behavior requires updating this class with refactoring. If you are interested, you can try, and I can help you. |
@jeanbisutti thanks for the quick reply |
I meant 1 select and 1 insert (in your query example, both a select and an insert statement seem executed). The code will have probably to be updated at many places, but I don't think it's difficult. The QuickPerf documentation should perhaps promote more the ExpectJdbcQueryExecution annotation that gives an idea of the number of JDBC roundtrips. This annotation seems not to be extensively used. To determine the exact number of JDBC roundtrips, instrumentation might help (QuickPerf uses only today a proxy on the datasource). |
I'm currently using Quickperf with jOOQ I'm currently still unsure whether Quickperf with jOOQ offers so many advantages compared to JPA. jOOQ delivers more expected SQL statements. What is striking, however, is that a large number of statements are not counted, since many statements are nested. Even functions with declare etc. are not working yet. In addition, the statements are strongly adapted to the database, so that it even makes sense to have different counts for one database. It would be great if you could specify the target database in the annotation. |
For information, you can use the ExpectJdbcQueryExecution annotation to check the number of JDBC executions. I would recommend using this annotation rather than
You can build a different datasource proxy in your tests with |
But then I need a separate test class for each database, correct?
Yes, as I said with JPA, I totally understand the advantage of QuickPerf and that's where we use it successfully and there have already been some hints about n+1 problems. Since jOOQ delivers less unexpected SQL, especially because you declare joins directly in the DSL, I'm still unsure whether the advantage here is that big. |
As far as I know.
QuickPerf is not only about the verification of the number of SQL statements. See for example the |
Describe the bug
An auto increment id is currently inserted with the following statement (H2).
select "ID" from final table (insert into...
The select statement is counted with @ExpectSelect. However, the actual insert statement does not.
This means that ExpectInsert is always 0 for a current insert statement.
Expected behavior
I would expect the insert statement to be counted.
Actual behavior
The insert statement is not counted.
To Reproduce
Use jooq with H2 and produce a store entity with a auto increment/identity primary key column id.
Should also be possible to use plain prepared statement with the same SELECT and the inner insert.
Versions
The text was updated successfully, but these errors were encountered: