Oracle 11g R2 – Why Public Synonyms Become Invalid

oracleoracle-11g-r2

I have 2 packages and 2 public synonyms for those packages. There are dependencies between those packages. If I make changes to any of those packages and compile them then packages are compiled (specs and bodies) and valid but both synonyms are invalid. I know I can recompile synonyms but how to avoid this please? Is there a way to keep all objects compiled?
Thank you.

Best Answer

If you are modifying any object in Oracle where a synonym is linked, there is no alternative, you should recreate the synonyms.

I found that because in my application I have sometime the need to recreate custom views (e.g. for attribute length) , and each time i need to recreate synonyms.

Even adding a rows in a table lead the synonym to be invalid.