I have use a synonym for a table in a Remote database. Application in remote site will insert data to source table, and my application will read those data via the synonym of the table.
Remote site application will send a TCP message after inserting a record to source table. My application execute a fetch once received that message.
But i detect that some records are fail to fetch because that does not available in the Table (Synonym) at the time of TCP message received.
Is there is possibility of having race condition in inserting and fetching in Synonyms ?
The presence (or absence) of a synonym has no impact.
If the source application commits before sending the notification and if your application is using the default read committed transaction isolation level, your application will see all the rows that were committed when it queries the database. The only exception that I am aware of would be if the remote database is a RAC database where the
MAX_COMMIT_PROPAGATION_DELAYis set to a non-zero value. Unless the remote database is an older (pre-10.2) version of Oracle, that would only be the case if someone had changed the default value for that parameter.You can determine the Oracle version by looking at
v$versionYou can determine whether
MAX_COMMIT_PROPAGATION_DELAYhas been set by queryingv$parameter(this will return 0 rows if the parameter has not been set)You can determine whether the database is a multi-node RAC cluster by querying
gv$instance. If this returns acount(*)of greater than 1, it is a multi-node RAC database