Question

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 ?

Was it helpful?

Solution

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_DELAY is 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$version

select * 
  from v$version

You can determine whether MAX_COMMIT_PROPAGATION_DELAY has been set by querying v$parameter (this will return 0 rows if the parameter has not been set)

select name, value 
  from v$parameter 
 where name = 'max_commit_propagation_delay'

You can determine whether the database is a multi-node RAC cluster by querying gv$instance. If this returns a count(*) of greater than 1, it is a multi-node RAC database

select count(*) 
  from gv$instance
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top