Archive for February, 2006

Config mgmt with Oracle program units

The configuration management(CM) processes on my current project are #^%& err … not really robust. Our development platform is VB with Oracle. CM tools are PVCS Version Manager (for source code control) and Merant Tracker (for bug tracking).

Flashback 3 months. Developer Alice changes program units directly in the database using GUI tools (such as SQL*Navigator). When she is satisfied with her masterpiece, she will extract the DDL to check it in into PVCS. If she is unlucky, before the DDL is extracted, developer Bob overwrites her changes by compiling the package from DDL sitting around on disk. She notices and an entertaining squabble ensues. If she is unluckier nobody notices.

Hmm, we need a way to ensure only one developer is working on a database program unit at a time. A google search leads us to this simple solution. The main components are:

  • A database table to record locks held by a developers on program units
  • A ‘BEFORE CREATE’ trigger on the application schema. This trigger ensures that the developer who is trying to overwrite a program unit has it locked. If not, it raises an exception preventing the overwrite.

We throw in a few modifications of our own:

  • It is easier on the developers if they don’t have to separately check-out the package in the version control system (PVCS) and the database. Fortunately PVCS provides a feature called Event Triggers. This allows command line programs to be set up that are automatically invoked on configured events. The user details, filename and a host of other information can provided as parameters to this program by PVCS. We roll our own little executable that locks a program unit in the database when the corresponding file is checked-out. The program unit is unlocked on check-in.
  • Locks are based on OS username instead of the Oracle username.

Flash forward to sysdate. Alice and Bob don’t squabble any more (atleast not as frequently as they compile database program units).

Leave a Comment

How to Make Great Photographs

Here is an article on photography I liked. The best part: it does not look down on amateur photographers who use the auto mode on their camera most of the time (err … all the time if you are like me). Here is a quote:

Yes, technical ability, in fact, virtuosity, is absolutely required for successful photography, however, this ability is nothing more than a mandatory prerequisite with which one might then be able make great photos. Luckily much of this fluency today is incorporated into automated cameras, making mastery much easier.

Leave a Comment

Hello world!

Impressed by Andy C’s blog and comments from Tim about good blog templates, I signed up at wordpress. Displaying my lack of originality, I will routinely post links to stuff I stumble upon. By now, the astute reader has no doubt made the connection between this revelation and the blog title. Given that I follow a lot of Oracle blogs, it is likely that a good number of these links have something to do with Oracle.

Comments (2)

Autonomous Transactions

Here is an article I initiated for the Dizwell wiki. Haven’t seen any edits or comments about it so far which could mean only one of three things: its perfect, its FUBAR or its somewhere in between.

Was not so sure if it was correct to contribute to an anonymous wiki and then announce it. However, I saw another author I respect do it, and that will be my excuse.

This issue with an anonymous wiki is, it might be exactly what I wrote when I posted this. But countless other people might improve it and all traces of what I wrote might be gone. So as a compromise between being fair and being vain, I will say I initiated that article.

Leave a Comment