I believe this is because the call1 and call2 were executed in two separate sessions so that the session one's sql result can not be seen by session two.
Since you don't show any actual code there is no way for anyone but you to knonw for sure. You posted this
call function 1()
if success, commit()
Was the INSERT of the parent record committed or not? If it was it doesn't matter if a different session was used for the child record.
So, I intended to keep both call1 and call2 in the same session by initiating the conn
conn.prepareCall("begin " +
How does is that 'initiating the conn'? What does 'initiating the conn' eve mean? I've never heard of that.
How can I keep the two separate connection in the same session?
You can't - each connection to the server has its own session. Either the same session needs to insert the parent and child records or you need to commit after the parent record is inserted (which you appear to show that you intend).