Forum Stats

  • 3,757,262 Users
  • 2,251,216 Discussions
  • 7,869,781 Comments

Discussions

INSERT statement results in extra network roundtrip with SELECT statement

mmagan-Oracle
mmagan-Oracle Member Posts: 30 Employee

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?
Tagged:

Answers

  • dsurber-Oracle
    dsurber-Oracle Member Posts: 195
    edited Aug 5, 2020 3:36PM

    The SQL log message should include the stack trace that is executing the SQL. That should point you in the right direction. There's no way I can think of that the JDBC driver would do this so what you are seeing is caused by some layer on top of JDBC.

    Edited to ask: Are you using a scroll sensitive result set or a scrollable/updateable result set of any kind?