We have an Java workflow application that uses an Oracle database to track its steps and interactions with other services. During a workflow run several insert/update/selec
This sounds like an issue with RAC, with connections to two different instances and the SCN is out of sync.
As a workaround, consider not closing the database connection and getting a new one, but reuse the same connection.
If that's not workable, then add a retry to the query that attempts to retrieve the inserted row. If the row is not returned, then sleep a bit, and retry the query again. Put that into a loop, after a specified number of retries, you can then fail.
[ADDENDUM]
In his answer, Steve Broberg (+1!) raises interesting ideas. I hadn't considered:
COMMIT
might be anything other than IMMEDIATE WAIT
I did consider the possibility of flashback query, and dismissed that out of hand without mentioning it, as there's no apparent reason the OP would be using flashback query, and no evidence of such a thing in the code snippet.)
[/ADDENDUM]