Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to access Subversion from Oracle PL/SQL?

Tags:

svn

oracle

plsql

For a governmental agency, we build a release management system developped in PHP and Oracle. The data for this application is stored in database tables and is processed with PL/SQL packages and procedures.

The release management process is extensively based on metadata coming from Subversion repositories. We access the repositories from PL/SQL through the internal Oracle JVM to execute svn commands on the unix server on which resides the Oracle instances. The results from svn commands are received in XML and parsed before beeing processed by PL/SQL. Accessing Subversion this way is not very performant for frequent repeated use.

Currently, what we do is storing the Subversion metadata in database tables at each commit in the Subversion repositories (via Subversion hooks). We extract the log information for each Subversion transaction and keep it in some oracle tables. We are then able to obtain Subversion metadata with normal SQL queries.

Is there better ways to access Subversion from PL/SQL ?

like image 389
Bergeroy Avatar asked Sep 26 '08 15:09

Bergeroy


People also ask

How do I open a cursor in PL SQL?

Open: A Cursor is opened and populated by executing the SQL statement defined by the cursor. Fetch: When the cursor is opened, rows can be fetched from the cursor one by one or in a block to perform data manipulation. Close: After data manipulation, close the cursor explicitly.

What is Oracle SVN?

Subversion is a powerful, open source version control system designed as a replacement for the popular Concurrent Versions System (CVS). It offers many enhancements to CVS, such as versioned directories and metadata, and is architected for simpler, more flexible network access.

What is SVN in database?

Apache Subversion (often abbreviated SVN, after its command name svn) is a software versioning and revision control system distributed as open source under the Apache License. Software developers use Subversion to maintain current and historical versions of files such as source code, web pages, and documentation.


2 Answers

If your using Oracle's Java JVM, you could try to use SVNKit to communicate with the SVN server nativly from Java, instead of shelling out to the operating system to execute commands.

like image 131
Steve K Avatar answered Oct 19 '22 20:10

Steve K


I think the basic flow makes sense. I would recommend doing experiments to see where exactly the performance bottlenecks are and then take if from there. For example, is it crossing from PL/SQL to Oracle JVM? Is it JVM shelling out to execute the svn command? Is it the svn round trip? Is it the parsing of the XML?

Let's say, for example, it's the svn round trip. Maybe you could have a process on the oracle machine that caches answers from the svn server so that at times the round trip could be avoided? Maybe the svn round trip could be async?

But, like I said, you need to know where the bottleneck is.

like image 33
Corey Trager Avatar answered Oct 19 '22 20:10

Corey Trager