[prev in list] [next in list] [prev in thread] [next in thread]
List: vectrics
Subject: [Vectrics] [Vectrics Forum] New Topic: Tips for Installing on Oracle
From: mailer () vectrics ! com
Date: 2006-07-11 18:54:24
Message-ID: 8323454.1152644066324.JavaMail.root () vectrics ! com
[Download RAW message or body]
Forum: [Installation and Configuration, id=3, order=2]
Topic: [113, Tips for Installing on Oracle]
User: ronmcnatt
The following is a summary of changes I completed to use Oracle as the DBMS.
Once I changed the Hibernate Dialect to Oracle, I ran the export sql schema ant task. \
The script it created did not create the statements to create the sequences in \
Oracle, so we ended up manually creating the tables, the sequences, and triggers to \
use the sequence upon insertion.
This really didn't cause too much of a problem since we have a seperate DBA group and \
I don't have rights to create tables. So with the tables, sequences, triggers built \
by the DBA, I had them create some stored procedures to drop all contraints, delete \
the data, and then reinforce the constraints. I modified the install ant task to \
call this new stored procedure to delete the data in the tables, instead of dropping \
and re-creating them. I then run the populating scripts with the modifications \
described below.
[b]Hibernate Mappings:[/b]
'user' is a reserved word in Oracle, so I changed User.hbm.xml to 'app-user' this \
also requires admin_user.sql to be edited to 'app-user'
'date' is a reserved word in Oracle, so I changed ObjectHistory.hbm.xml to 'obj_date'
'level' is a reserved word in Oracle, so I changed JobSkillRating.hbm.xml to \
'skill_level'.
edit the hibernate mappings to reference the creates sequences, example:
<class name="org.vectrics.location.Address" table="address">
<id name="id" column="id" type="java.lang.Long" unsaved-value="null">
<generator class="native" />
[color=red]<param name="sequence">SEQ_ADDRESS_ID</param> [/color]
</id>
[b]Database Seeding Scripts:[/b]
I had to cast all the dates in the sql scripts, like the following example:
to_date('2001-1-1', 'YYYY-MM-DD')
Empty Strings are not allowed in Oracle so '' was changed to insert a space to ' '
You have to double quote '' to use an apostrophe in a String
Remove all auto-incrementing Id's in the seeding scripts. Otherwise you will insert \
values into the tables without incrementing the sequences and the application will \
fail when you perform an insert into the table. Ex. adding users, the scripts add 4 \
users, app will fail when you try to add a new user. Remove value insertions into \
auto-incremented fields in DB for the following tables: cms-section, company, domain, \
domain_loc, html_css, person (admin_user.sql in order-5), phrase, system_constants, \
app_user
[b]Code Change[/b]
Vectrics-core\src\org\vectrics\location\LocationPersistMgr.java
locate the 'findChildren' method and change location.voided from 0 to 'F'.
MySql evaluates 0 as false, Oracle doesn't, this bug was fun to find :-)
[b]Change Datasource[/b]
Don't forget to change the datasource in Jboss, vectrics-ds.xml
These changes represent a decent amount of work, some changes like the reserved words \
for tables and column names can be eliminated with future releases.
Hope this helps those on the Oracle road.
-- Ron McNatt
You received this email because a new FlashRecruit topic of was created in the \
Vectrics forum. The topic title is "Tips for Installing on Oracle", and you can use \
the following URL to read it: http://www.vectrics.com/jforum/posts/list/113.page#293
If you no longer want to receive notifications for this forum, please access \
http://www.vectrics.com/jforum/forums/unwatchForum/3.page \
_______________________________________________ Vectrics mailing list
Vectrics@qbang.org
http://mailman.qbang.org/mailman/listinfo/vectrics
FlashRecruit is an Open Source Job Board and Applicant Tracking software application. \
Built for J2EE application servers, FlashRecruit is enterprise ready and will scale \
with your business. FlashRecruit leverages standard Java enterprise components \
including Struts, Hibernate, Apache Lucene and Quartz.
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic