如何从 Oracle PL/SQL 访问 Subversion?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/140153/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to access Subversion from Oracle PL/SQL?
提问by Bergeroy
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.
对于政府机构,我们构建了一个用 PHP 和 Oracle 开发的发布管理系统。此应用程序的数据存储在数据库表中,并使用 PL/SQL 包和过程进行处理。
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.
发布管理过程广泛基于来自 Subversion 存储库的元数据。我们通过内部 Oracle JVM 从 PL/SQL 访问存储库,以在驻留 Oracle 实例的 unix 服务器上执行 svn 命令。svn 命令的结果以 XML 格式接收并在被 PL/SQL 处理之前进行解析。以这种方式访问 Subversion 对于频繁重复使用来说性能不是很好。
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.
目前,我们所做的是在 Subversion 存储库中的每次提交时将 Subversion 元数据存储在数据库表中(通过 Subversion 挂钩)。我们提取每个 Subversion 事务的日志信息并将其保存在一些 oracle 表中。然后我们就可以通过普通的 SQL 查询获取 Subversion 元数据。
Is there better ways to access Subversion from PL/SQL ?
有没有更好的方法从 PL/SQL 访问 Subversion?
采纳答案by Steve K
回答by Corey Trager
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?
我认为基本流程是有道理的。我建议进行实验以查看性能瓶颈的确切位置,然后从那里进行判断。例如,它是否从 PL/SQL 跨越到 Oracle JVM?执行 svn 命令是否是 JVM 脱壳?是svn往返吗?它是解析 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?
比方说,例如,这是 svn 往返。也许你可以在 oracle 机器上有一个进程来缓存来自 svn 服务器的答案,以便有时可以避免往返?也许 svn 往返可能是异步的?
But, like I said, you need to know where the bottleneck is.
但是,就像我说的,你需要知道瓶颈在哪里。
回答by Corey Trager
I'm also looking for an API to integerate Subversion and Oracle. I need to be able to pull Oracle PL/SQL objects (procedures, packages) into Subversion and then once changes are made to objects it should be applied to those objects in Oracle database.
我也在寻找一个 API 来整合 Subversion 和 Oracle。我需要能够将 Oracle PL/SQL 对象(过程、包)提取到 Subversion 中,然后一旦对对象进行更改,它就应该应用于 Oracle 数据库中的这些对象。
回答by Nikolay Antipov
One more solution is to use software which stays between ORACLE and SVN and synchronizes PL/SQL with sources.
另一种解决方案是使用位于 ORACLE 和 SVN 之间的软件,并将 PL/SQL 与源同步。
Here is one of these programs which can be started by cron: https://sourceforge.net/projects/dbcode-svn-sync/.
这是可以由 cron 启动的这些程序之一:https: //sourceforge.net/projects/dbcode-svn-sync/。