We use SQL Developer for the bulk of our database work and ODT for Visual Studio for source control. We recently ran into a problem where our scripts were not updating with the server version and nearly lost a significant amount of work (but we didn't thanks to flashback). If a package is modified on the server outside of my Visual Studio instance, the "Generate Create Script to Project" does not get the latest server version and instead seems to get a cached version of the package based on when it was last examined by server explorer.
Steps to Reproduce:
Create a package spec and body on the server.
Open an Oracle Database Project.
Open connection to DB/Schema.
Expand packages node.
Select a package node in Server Explorer and "Generate Create Script to Project" from the context menu. This will generate a spec and body script.
Modify the package using an external tool (SQL Developer).
Select the same package in Server Explorer and "Generate Create Script to Project"
The script will not be updated with the changes made on the server.
A couple of notes:
If I disconnect and reconnect, it will refresh everything and I can get the server version of the SQL. The body will be updated.
If I refresh the connection node and generate the script the package body will updated.
If I refresh the packages node and generate the script the package body will not updated.
If I refresh the package parent node and generate the script the package body will not updated.
If I expand the body node for the first time and generate script from the package parent node the package body will updated.
If the package body has been expanded and I refresh any parent node and generate the script the package body will updated.
At the very least, I would expect refreshing a parent node to refresh all siblings.
If the caching is by design, it would be nice to know if the package had been modified from its cached version. Otherwise, it should get the server version.
Oracle Developer Tools for Visual Studio 22.214.171.124.20