Skip to Main Content

Java Database Connectivity (JDBC)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Statement::executeUpdate blocks if no row is affected on UPDATE

User_OKRQAOct 31 2022

When calling 'Statement::executeUpdate' it works fine and returns the number of affected rows for INSERT and UPDATE as long as a row is inserted or updated, or on INSERT a key constraint is violated.
However, if I do an UPDATE which due to the key does not change any row (in fact for the test, the table is empty) it never returns or throws an exception. It simply blocks till I kill my process.
The idea behind is :
default is updating existing records, but if this fails since key is not found,
the first record is inserted
It was already working, but in the meantime, the server had to be re-installed, so, I guess, it could be a server config issue, but no idea what.

Comments

Processing

Post Details

Added on Oct 31 2022
0 comments
533 views