[Dspace-devel] [DSpace-JIRA] Commented: (DS-297) Refactor SQL source and Ant script to avoid copying Oracle versions over PostgreSQL

0 views
Skip to first unread message

Mark Diggory (JIRA)

unread,
Aug 19, 2015, 2:54:53 PM8/19/15
to dspace...@lists.sourceforge.net

[ http://jira.dspace.org/jira/browse/DS-297?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=10521#action_10521 ]

Mark Diggory commented on DS-297:
---------------------------------

InitializeDatabase already lookes in the appropriate directory. I believe you are not setting your db.name appropriately in the dspace.cfg you are running your ant build against.

See: https://scm.dspace.org/svn/repo/dspace/trunk/dspace-api/src/main/java/org/dspace/storage/rdbms/InitializeDatabase.java

/**
* Attempt to get the named script, with the following rules:
* etc/<db.name>/<name>
* etc/<name>
* <name>
*/
private static FileReader getScript(String name) throws FileNotFoundException, IOException
{
String dbName = ConfigurationManager.getProperty("db.name");
File myFile = null;

if (dbName != null)
{
myFile = new File("etc/" + dbName + "/" + name);
if (myFile.exists())
return new FileReader(myFile.getCanonicalPath());
}

myFile = new File("etc/" + name);
if (myFile.exists())
return new FileReader(myFile.getCanonicalPath());

return new FileReader(name);
}


Mark




> Refactor SQL source and Ant script to avoid copying Oracle versions over PostgreSQL
> -----------------------------------------------------------------------------------
>
> Key: DS-297
> URL: http://jira.dspace.org/jira/browse/DS-297
> Project: DSpace 1.x
> Issue Type: Improvement
> Components: Documentation, DSpace API
> Affects Versions: 1.6.0
> Environment: n/a
> Reporter: Larry Stone
> Priority: Minor
>
> The current installation procedure for Oracle requires the Oracle SQL files to be _copied over_ the PostgreSQL versions; this is a kludgy modification to the source code hierarchy that renders your local copy different from the prototype, e.g. in svn. This is an unnecessary and gratuitous difference, and it also adds a confusing step to the installation just for Oracle users, who are already likely to be more confused than their luckier PostgreSQL colleagues.
> I propose putting the SQL files for Oracle, PostgreSQL, and whatever other DBs may someday get supported, side-by-side in peer directories, and have them used in place without any copying. The only change to the source tree would be to add dspace/etc/postgres and move all the "default" SQL files in dspace/etc to there. Then, the build.xml script would simply insert the value of the "db.name" configuration property (ant can read properties easily) into the path, or modify org.dspace.storage.rdbms.InitializeDatabase to do so. There would no longer be any need to modify the source tree as part of an Oracle installation.
> I'm willing to do this and update the documentation, for 1.6.

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.dspace.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira



Larry Stone (JIRA)

unread,
Aug 19, 2015, 2:54:53 PM8/19/15
to dspace...@lists.sourceforge.net

Larry Stone (JIRA)

unread,
Aug 19, 2015, 2:54:53 PM8/19/15
to dspace...@lists.sourceforge.net

[ http://jira.dspace.org/jira/browse/DS-297?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=10522#action_10522 ]

Larry Stone commented on DS-297:
--------------------------------

Actually, I made the mistake of believing the documentation. My config file was fine. In dspace/docs/html/ch03.html#N10784,

"Oracle...

d. Go to [dspace-source]/dspace/etc/oracle and copy the contents to their parent directory, overwriting the versions in the parent:

cd [dspace-source]/dspace/etc/oracle
cp * ..

You now have Oracle-specific .sql files in your etc directory, and your dspace.cfg is modified to point to your Oracle database.

So, it looks like moving the PostgreSQL-specific SQL to a "postgres" subdirectory would Just Work. I still think that's worth doing to improve clarity. In the unlikely case there is any common SQL, it can go directly under [dspace]/etc.

Larry Stone (JIRA)

unread,
Aug 19, 2015, 3:00:08 PM8/19/15
to dspace...@lists.sourceforge.net

[ http://jira.dspace.org/jira/browse/DS-297?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Larry Stone resolved DS-297.
----------------------------

Documentation Status: In Comments (was: Needed)
Resolution: Fixed
Fix Version/s: 1.6.0
Assignee: Larry Stone

As agreed, I've moved the PostgreSQL-specific files into a subdirectory etc/postgres, so it is clear (especially to beginners and/or Oracle-using sites) to which database the code pertains.

Documentation: I also updated the DocBook source to reflect these changes, and remove the mistaken instruction to "copy the Oracle SQL files to the top level". I was only able to check that the XML is well-formed, however, not having docbook production tools nor time to shave enough yaks to install them, so I apologize if there are any errors. The changes are in revision 4427 if you want to check them against the presentation version.

> Refactor SQL source and Ant script to avoid copying Oracle versions over PostgreSQL
> -----------------------------------------------------------------------------------
>
> Key: DS-297
> URL: http://jira.dspace.org/jira/browse/DS-297
> Project: DSpace 1.x
> Issue Type: Improvement
> Components: Documentation, DSpace API
> Affects Versions: 1.6.0
> Environment: n/a
> Reporter: Larry Stone
> Assignee: Larry Stone
> Priority: Minor
> Fix For: 1.6.0
Reply all
Reply to author
Forward
0 new messages