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!

INSERT statement results in extra network roundtrip with SELECT statement

mmagan-OracleAug 1 2020 — edited Aug 5 2020

Using jdbc ojdbc8_g with a Groovy script.

If I execute an insert statement with bind variables, then I see this in the jdbc log (as expected):

Aug 01, 2020 9:08:32 AM oracle.jdbc.driver.OracleStatement logSQL

CONFIG: 16AED49F SQL: INSERT INTO Author (firstname, lastname) VALUES (?, ?)

However, I noticed (using Wireshark) that two network roundtrips were being performed. One for the INSERT, and then another with a SELECT statement: SELECT firstname,lastname FROM Author

If I set the JDBC logging level to FINEST then I also see the select statement.

  • What is the purpose of this statement?
  • How can this extra network roundtrip be avoided?

Comments

Post Details

Added on Aug 1 2020
1 comment
141 views