Hello Rob, I have fixed a similar issue to yours: https://github.com/jOOQ/jOOQ/issues/3011
The fix will be merged to 3.1.1 and 3.2.4. However, your issue seems quite curious and possibly not related to #3011. The reason why jOOQ calls Statement.execute() instead of Statement.executeUpdate() is due to an issue when plain SQL is executed through Query.execute() instead of ResultQuery.fetch(), even if it returns result sets. A corner case in some JDBC drivers. More information here: https://github.com/jOOQ/jOOQ/issues/1829 In order to thoroughly fix this, I would need to write regression tests. Can you provide me with some DDL (including potential triggers) of the table you're trying to insert data into? Cheers Lukas 2014-02-14 19:02 GMT+01:00 Lukas Eder <[email protected]>: > Hi Rob, > > Thanks for cross-linking. This is indeed curious, and I'll be > investigating this next week, as Venkat has shown similar symptoms on the > user group in another thread here: > https://groups.google.com/forum/#!topic/jooq-user/Rzj96HIliBo > > I have created an issue for this here: > https://github.com/jOOQ/jOOQ/issues/3054 > > Cheers > Lukas > > > 2014-02-13 16:12 GMT+01:00 Rob Nikander <[email protected]>: > > Hi, >> >> This is not primarily a jOOQ problem, but it's causing one for me and I >> thought maybe someone here would know what the problem is. I have an >> simple update query that is is returning 0 from `execute`, when it should >> be 1. I see that jOOQ is calling the JDBC Statement methods `execute` and >> then `getUpdateCount`, as opposed to `executeUpdate`. The former is, >> oddly, returning 0 when I think it should be returning 1. The latter >> returns 1 as expected. I posted to stackoverflow about this. [1] >> >> This is MS SQL Server 2008, and I tried with both JDBC drivers (microsoft >> and jtds). And I can't reproduce it on other tables. >> >> Rob >> >> [1] >> http://stackoverflow.com/questions/21757191/jdbc-getupdatecount-is-returning-0-but-1-row-is-updated-in-sql-server >> >> -- >> You received this message because you are subscribed to the Google Groups >> "jOOQ User Group" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected]. >> For more options, visit https://groups.google.com/groups/opt_out. >> > > -- You received this message because you are subscribed to the Google Groups "jOOQ User Group" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.
