Could this possibly lead to dead-locks? If someone is trying to create a table and another trying to create a synonym could possibly block each other. I have a feeling you have a better way to do this, so what is it?

Satheesh
Well, I currently check if a table of same name is present before allowing a synonym to be created. Same the other way. Not good? :-\ 

Satheesh

Daniel John Debrunner wrote:
Satheesh Bandaram wrote:

  
I almost submitted a patch using option 1, like I said I would. I have
added a SynonymAliasInfo to hold target of a synonym, which is
schemaName.tableName. I think this schemaName needs to be stored as a
name, instead of an ID so that the synonym stays valid even after
droping and recreating the target schema.
    

That seems like correct behaviour.

  
Yes, the namespace for SYNONYM is the same for tables and views. You
can't create a synonym if a table of that name already exists.
    

An explanation of how this is enforced would be good, another approach
would be to introduce a new table type in SYSTABLES, and then the
uniqueness would be handled by the existing code. Maybe you are doing
that already. I guess I should wait for the patch. :-)

Dan.



  

Reply via email to