gnumed-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnumed-devel] re: openemeds


From: syan tan
Subject: [Gnumed-devel] re: openemeds
Date: Fri, 19 Dec 2003 09:44:25 +1100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3) Gecko/20030313

the previous configuration wasn't actually working; the application was just using the hypersonic sql database. The actually configuration would be worthy of any combined student process : instead of changing perhaps 2 files for each of coas and pids servers, there's about six scattered in the dist/servers tree. It was also a good demostration that sql vendors don't want interoperability : e.g. mysql uses BLOB and LONGTEXT, while postgres uses BYTEA and TEXT
in their respective sqls.

The files to change are ( base directory dist/servers) : ./postgresql.properties (copy from mysql.properties and alter) ./coas/ojb/config/postgresql_repository.xml ( copy from mysql_repository.xml and alter) , ./coas/ojb/config/postgresql_coas.sql (copy from mysql_coas.sql and alter) , the ./coas/coas.cfg ( alter Database property) and ./coas/OJB.properties (alter repositoryFile property). For the dist/servers/pids the process is the same, except that pids/server.cfg is the config that matches ./coas/coas.cfg ( instead of pids.cfg as expected). To alter the build.xml file, just substitute the new sql script file path in the copied over create_pids_mysql task; the run pids / run coas tasks mysql.classpath variable comes from mysql.properties file, so alter this if it is renamed to postgres.classpath in your constructed postgres.properties
file.
Manually createdb a db called coas and pids, and a user /password openemed/openemed.

Then to run , run "ant nameservice", then "ant coas", and "ant pids", then try out in the client directory, "ant pidsclient" and "ant simplecoas".

The structure seems to be , ( client -> CORBA ( nameservice, domain specific pids and coas servers) -> OJB ( apache object-relational mapper) -> sql.

Does anyone think we should get sucked in by their invitation to build a client for their backend? (it'll probably be non-gpl able, won't it?).

Attached are the config files for the pids side to use postgres, moving up the tree from the dist/servers directory into dist/servers/pids










postgres.classpath=${lib.dir}/pg73dbc2.jar
relational.driver=org.postgresql.Driver
pids_pg.url=jdbc:postgresql://localhost/pids
coas_pg.url=jdbc:postgresql://localhost/coas

PIDS.userid=openemed
PIDS.password=openemed

COAS.userid=openemed
COAS.password=openemed
<?xml version="1.0"?>

<!-- ======================================================================= -->
<!-- Ant own build file                                                      -->
<!-- ======================================================================= -->

<project name="servers-persistent" default="targets" basedir="../..">
<target name="init" >
  <property name="Name" value="Servers-persistent"/>
  <property name="name" value="servers-persistent"/>

  <property name="base.dir" value="${basedir}"/>
  <property name="src.dir" value="${base.dir}/dist/servers"/>
  <property name="lib.dir" value="${base.dir}/lib"/>
  <property name="dist.dir" value="${base.dir}/dist"/>
  <property name="dist.lib.dir" value="${dist.dir}/lib"/>
  <property name="persistent.build.classes" 
value="${dist.lib.dir}/servers-persistent.jar"/>
  <property name="transient.build.classes" 
value="${dist.lib.dir}/servers-transient.jar"/>
  <property name="persistent.classpath" 
value="${persistent.build.classes};${src.dir};${dist.lib.dir}/omg.jar;${dist.lib.dir}/corbamed.jar;${dist.lib.dir}/tools.jar;${dist.lib.dir}/OpenEMed.jar"/>
  <property name="transient.classpath" 
value="${transient.build.classes};${src.dir};${dist.lib.dir}/omg.jar;${dist.lib.dir}/corbamed.jar;${dist.lib.dir}/tools.jar;${dist.lib.dir}/OpenEMed.jar"/>
  <property name="poet.classpath" 
value="${persistent.classpath}:${java.class.path}" />
  <property file="${src.dir}/oracle.properties"/>
  <property file="${src.dir}/hsqldb.properties"/>
  <property file="${src.dir}/mysql.properties"/>
  <property file="${src.dir}/postgres.properties"/>
  <property name="args" value=""/>
  <property file="${basedir}/local.properties"/>

  <path id="compilation-classpath">
        <fileset dir="${lib.dir}">
                <include name="*.jar"/>
        </fileset>
        <fileset dir="${orb.dir}">
                <include name="*.jar"/>
        </fileset>
  </path>
  <property name="comp.classpath" refid="compilation-classpath"/>
  

  <!-- Give user a chance to override without editing this file 
       (and without typing -D each time it compiles it -->
  <property file="${user.home}/.ant.properties" />


</target>
 
   <!-- Display all the targets -->
  <target name="targets">
    <echo message="ANT build for ${project} ${version}"/>
    <echo message=""/>
    <echo message="The following targets are available:"/>
    <echo message="  targets  Lists the build targets"/>
    <echo message="  create_coas   Creates the HSQLDB database for COAS 
service"/>
    <echo message="  create_pids   Creates the HSQLDB database for PIDS 
service"/>
    <echo message="  create_oracle        Creates the Oracle database for 
OpenEMed"/>
    <echo message="  create_coas_oracle   Creates the Oracle database for COAS 
service"/>
    <echo message="  create_coas_mysql    Creates the MySQL database for COAS 
service"/>
    <echo message="  create_pids_oracle   Creates the Oracle database for PIDS 
service"/>
    <echo message="  create_pids_mysql   Creates the MySQL database for PIDS 
service"/>
    <echo message="  nameservice      Starts the nameservice"/>
    <echo message="  coas      Starts the COAS server "/>
    <echo message="  pids      Starts the PIDS server "/>
    <echo message="  rad       Starts the RAD server "/>
    <echo message=""/>
  </target>

 
  <!-- =================================================================== -->
  <!-- Check to see what optional dependencies are available               -->
  <!-- =================================================================== -->
  <target name="check_for_optional_packages">
    <available property="oracle.present" 
classname="oracle.jdbc.driver.OracleDriver">
        <classpath refid="compilation-classpath"/>
    </available>
    <available property="jdx.present" classname="com.softwaretree.jdx.JDXS" >
        <classpath refid="compilation-classpath"/>
    </available>
    <available property="poet.present" classname="com.poet.tools.ptjx.Main" >
        <classpath refid="compilation-classpath"/>
    </available>
    <available property="jndi.present" classname="javax.naming.Name" >
        <classpath refid="compilation-classpath"/>
    </available>
    <available property="ibutton.present" classname="COM.iButton.cibButton">
        <classpath refid="compilation-classpath"/>
    </available>
    <available property="ob.present" classname="com.ooc.CORBA.ORB">
        <classpath refid="compilation-classpath"/>
    </available>
    <available property="openorb.present" classname="org.openorb.orb.core.ORB">
        <classpath refid="compilation-classpath"/>
    </available>   
  </target>



  <!-- =================================================================== -->
  <!-- Server startups with database creation                                   
         -->
  <!-- =================================================================== -->

  <!-- Start Nameservice in directory dist/servers-->
  <target name="nameservice" depends="init, check_for_optional_packages" >
          <antcall target="orb_nameservice"/>
          <antcall target="ob_nameservice"/>
  </target>
  <target name="orb_nameservice"  if="openorb.present">
        <parallel>
        <java fork="true" classname="org.openorb.tns.Server" 
dir="${dist.dir}/servers"  
                  classpath="${comp.classpath}">
                        <jvmarg value="-Dorg.omg.CORBA.ORBClass=${ORBClass}"/>
                        <jvmarg 
value="-Dorg.omg.CORBA.ORBSingletonClass=${ORBSingletonClass}"/>
                        <arg value="-ORBiiop.port=${iiop.port}"/> 
                        <arg value="-ORBiiop.hostname=${iiop.hostname}"/> 
                        <arg value="-print"/>
                        <arg value="-printIOR"/>
        </java>
        </parallel>
  </target>

 <!-- Start Orbacus Nameservice in directory dist/servers-->
  <target name="ob_nameservice"  if="ob.present">
  <parallel>
        <java fork="yes" classname="com.ooc.CosNaming.Server" 
dir="${dist.dir}/servers"  
                  classpath="${comp.classpath}">
                        <jvmarg line="-Dorg.omg.CORBA.ORBClass=${ORBClass} 
-Dorg.omg.CORBA.ORBSingletonClass=${ORBSingletonClass}"/>
                        <arg line="-OAport ${iiop.port} -OAhost 
${iiop.hostname} -d OrbacusNameService.db -i ${name.start}"/>
        </java>
        </parallel>
  </target>  
  <!-- create oracle database users and roles -->
  <!--target name="create_oracle" if="oracle.present" 
depends="init,check_for_optional_packages"-->
  <target name="create_oracle" depends="init,check_for_optional_packages">
        <echo message="${src.dir}"/>
        <sql driver="oracle.jdbc.OracleDriver" url="${oracle.url}" 
userid="${oracle.SYS.userid}" 
                 password="${oracle.SYS.password}" src="${src.dir}/oracle.sql" 
                 autocommit="true" print="true" onerror="continue" 
classpath="${oracle.classpath}" 
                 rdbms="oracle"/>
        <echo message="create_oracle done!"/>
  </target>     
  
  <!-- create oracle database for COAS service -->
  <target name="create_coas_oracle" depends="init,check_for_optional_packages">
        <sql driver="oracle.jdbc.driver.OracleDriver" url="${oracle.url}" 
userid="${oracle.COAS.userid}" 
                 password="${oracle.COAS.password}" 
src="${src.dir}/coas/ojb/config/oracle_coas.sql" 
                 autocommit="true" print="true" onerror="continue" 
classpath="${oracle.classpath}" 
                 rdbms="oracle"/>
        <echo message="create_coas_oracle done!"/>
  </target>     
  <!-- create mysql database for COAS service -->
  <target name="create_coas_mysql" depends="init">
        <sql driver="org.gjt.mm.mysql.Driver" url="${coas_mysql.url}" 
userid="${PIDS.userid}" 
                 password="${PIDS.password}" 
src="${src.dir}/coas/ojb/config/mysql_coas.sql" 
                 autocommit="true" print="true" onerror="continue" 
classpath="${mysql.classpath}"  
                 />
        <echo message="create_coas_mysql done!"/>
  </target>     

  <target name="create_coas_pg" depends="init">
        <sql driver="org.postgresql.Driver" url="${coas_pg.url}" 
userid="${PIDS.userid}" 
                 password="${PIDS.password}" 
src="${src.dir}/coas/ojb/config/pg_coas.sql" 
                 autocommit="true" print="true" onerror="continue" 
classpath="${pg.classpath}"  
                 />
        <echo message="create_coas_pg done!"/>
  </target>     
  
  <!-- create oracle database for PIDS service -->
  <target name="create_pids_oracle" if="oracle.present" 
depends="init,check_for_optional_packages">
        <sql driver="oracle.jdbc.driver.OracleDriver" url="${oracle.url}" 
userid="${oracle.PIDS.userid}" 
                 password="${oracle.PIDS.password}" 
src="${src.dir}/pids/ojb/config/pids_oracle.sql" 
                 autocommit="true" print="true" onerror="continue" 
classpath="${oracle.classpath}" 
                 rdbms="oracle"/>
        <echo message="create_pids_oracle done!"/>
  </target>     
  
  <!-- create hsqldb database for PIDS service -->
  <target name="create_pids" depends="init">
        <sql driver="org.hsqldb.jdbcDriver" url="${pids.url}" 
userid="${HSQL.PIDS.userid}" 
                 password="${HSQL.PIDS.password}" 
src="${src.dir}/pids/ojb/config/pids_hsqldb.sql" 
                 autocommit="true" print="true" onerror="continue" 
classpath="${hsqldb.classpath}"  
                 />
        <echo message="create_pids done!"/>
  </target>     
  
  <!-- create mysql database for PIDS service -->
  <target name="create_pids_mysql" depends="init">
        <sql driver="org.gjt.mm.mysql.Driver" url="${pids_mysql.url}" 
userid="${PIDS.userid}" 
                 password="${PIDS.password}" 
src="${src.dir}/pids/ojb/config/pids_mysql.sql" 
                 autocommit="true" print="true" onerror="continue" 
classpath="${mysql.classpath}"  
                 />
        <echo message="create_pids_mysql done!"/>
  </target>     

  <target name="create_pids_pg" depends="init">
        <sql driver="${relational.driver}" url="${pids_pg.url}" 
userid="${PIDS.userid}" 
                 password="${PIDS.password}" 
src="${src.dir}/pids/ojb/config/pids_postgresql.sql" 
                 autocommit="true" print="true" onerror="continue" 
classpath="${pg.classpath}"  
                 />
                 <!-- use mysql sql script for postgres -->
        <echo message="create_pids_pg done!"/>
  </target>     
  <!-- create hsqldb database for COAS service -->
  <target name="create_coas" depends="init">

        <sql driver="org.hsqldb.jdbcDriver" url="${coas.url}" 
userid="${HSQL.COAS.userid}" 
                 password="${HSQL.COAS.password}" 
src="${src.dir}/coas/ojb/config/hsqldb_coas.sql" 
                 autocommit="true" print="true" onerror="continue" 
classpath="${hsqldb.classpath}"  
                 />
        <echo message="create_coas done!"/>
  </target>     

<!--  The Server targets: -->  
  <!-- Start COAS -->
 <target name="coas" depends="init">
        <property name="dir" value="${src.dir}/coas"/>
        <parallel>
        <java fork="yes" classname="gov.lanl.COAS.ObservationComponentImpl" 
dir="${dir}" 
                
classpath="${dir}:${persistent.classpath}:${comp.classpath}:${pg.classpath}:${classpath}">
                        <jvmarg line="${jvmarg} 
-Dorg.omg.CORBA.ORBClass=${ORBClass} 
-Dorg.omg.CORBA.ORBSingletonClass=${ORBSingletonClass}"/>
                        <arg line="-file coas.cfg -ORBconfig orb.properties 
${args}"/>
        </java>
        </parallel>
  </target>
 
  <!-- Start PIDS -->
 <target name="pids" depends="init">
        <property name="dir" value="${src.dir}/pids"/>
        <parallel>
        <java fork="yes" 
classname="gov.lanl.PidServer.IdentificationComponentImpl" dir="${dir}" 
                
classpath="${dir}:${persistent.classpath}:${comp.classpath}:${pg.classpath}:${classpath}">
                        <jvmarg line="${jvmarg} 
-Dorg.omg.CORBA.ORBClass=${ORBClass} 
-Dorg.omg.CORBA.ORBSingletonClass=${ORBSingletonClass}"/>
                        <arg line="-file server.cfg -ORBconfig orb.properties 
${args}"/>
        </java>
        </parallel>
  </target>
 <!-- Start RAD -->
 <target name="rad" depends="init">
        <property name="dir" value="${src.dir}/RAD"/>
        <parallel>
        <java fork="yes" classname="gov.lanl.RAD.AccessDecisionImpl" 
dir="${dir}" 
                
classpath="${dir}:${transient.classpath}:${comp.classpath}:${mysql.classpath}:${classpath}">
                        <jvmarg line="${jvmarg} 
-Dorg.omg.CORBA.ORBClass=${ORBClass} 
-Dorg.omg.CORBA.ORBSingletonClass=${ORBSingletonClass}"/>
                        <arg line="-file policy.cfg -ORBconfig orb.properties 
${args}"/>
        </java>
        </parallel>
  </target>




 

</project>

# PIDS Server configuration file
#
# To run PIDS Server:
#
#       cd <directory with pids.jar>
#
#       PidsServer

# Additional config file(s)
#File   other_file.cfg

# 'DomainName' - ID Domain Name this component resides in.
DomainName=DNS:doh.state.nm.us

# 'ComponentName' - Component Name for this component
ComponentName=DNS:doh.state.nm.us
ComponentLocalName=Pilot
ComponentVersion=1.0

# 'profiles' - the file to find initial profiles in
profiles=profiles.cfg
#profiles=new-profiles.cfg
# uncomment line to load the profiles specified above
load profiles

serverName=us/nm/state/doh/Pilot
#authenServerName=TMAuthenticate

# use these for the sO Database
#DBMgr=sO
#DataBase=sOpids-daughter

DBMgr=OJB

# for OJB, the Database is specified in the OJB.properties as the repositoryFile
# ORACLE
#DataBase=ojb//config//0.9/oracle_repository.xml

# HSQLDB
#DataBase=ojb//config//hsqldb_repository.xml

# MYSQL
#DataBase=ojb//config//mysql_repository.xml

#postgresql 
DataBase=ojb//config//postgresql_repository.xml

# use these for the POET database
#DBMgr=POET
#DataBase=poet://LOCAL/pids.db

# use these for the JDX supported RDBMS
#DBMgr=JDX
#DataBase 
jdbc:odbc:newpids;user=dwf;password=cruft;JDX_ORMFile=pids-access.jdx;DEBUG_LEVEL=5

TARGETCLASS=gov.lanl.PidServer.IdentificationComponentImpl

gov.lanl.PidServer.IdentificationComponentImpl     +READ+
gov.lanl.PidServer.IdentityAccessImpl              +READ+
gov.lanl.PidServer.ProfileAccessImpl               +READ+
gov.lanl.PidServer.IdMgrImpl                       +READ+EDIT+
gov.lanl.PidServer.SequentialAccessImpl            +READ+
gov.lanl.PidServer.IdentifyPersonImpl              +READ+
update_and_clear_traits        +READ+EDIT+

traits=traits.cfg
#iorfile=/tmp/pids.ior
iorfile=pids.ior

#TraderIORFile=http://hope.acl.lanl.gov/TeleMed/trader.ref
#TraderIORFile=http://telemed.acl.lanl.gov/images/trader.ref
#TraderIORFile=./trader.ior

# 'DefaultNewState' - The default state that new IDs will be created as

# CorrelationMgrIOR - the IOR of the CorrelationMgr for this pids
# (if one exists); in other words uncomment the line below to have this
# pids "registered" with the CorrelationMgr interface of the indicated PIDS
#CorrelationMgrIOR=./MasterPids.ior
#
# CorrelationUpdateInterval - the number of seconds of the interval at
# which updated information should be posted to the
# CorrelationMgr PIDS (note: default set in code, to 30 min, 1800 sec)
CorrelationUpdateInterval=600
#
# CorrelationMgr - is this PIDS a CorrelationMgr; if so un-comment the line
# below; otherwise, it is not a CoorelationMgr
#
CorrelationMgr=Yes
#CorrelationMgr=No
#
domains=DNS:hsc.unm.edu
# ----

# '' - 

# '' - 

# '' - 

# '' - 

# '' - 

# OJB.properties -- configuration of the OJB runtime environment
# Version: 1.0
# (c) 2001, 2002, 2003 Apache Software Foundation
# Author: Thomas Mahler and many others
#
#----------------------------------------------------------------------------------------
# repository file settings
#----------------------------------------------------------------------------------------
# The repositoryFile entry tells OJB to use this file as as its standard mapping
# repository. The file is looked up from the classpath.
#
#repositoryFile=ojb//config//mysql_repository.xml
#repositoryFile=ojb//config//hsqldb_repository.xml
repositoryFile=ojb//config//postgresql_repository.xml
#
# If the useSerializedRepository entry is set to true, OJB tries to load a
# serialized version of the repository for performance reasons.
# if set to false, OJB always loads the xml file.
# Setting this flag to true will accelerate the startup sequence of OJB.
# If set to true changes to the repository.xml file will only be detected
# after maually deleting the repository.xml.serialized file.
useSerializedRepository=false
#
# If Repository serialization is used the entry serializedRepositoryPath 
defines the
# directory where the Repository is written to and read from.
# this entry is used only when the useSerializedRepository flag is set to true
#
serializedRepositoryPath=.
#
#----------------------------------------------------------------------------------------
# PersistenceBrokerFactory / PersistenceBroker
#----------------------------------------------------------------------------------------
# The PersistenceBrokerFactoryClass entry decides which concrete
# PersistenceBrokerFactory implemention is to be used.
PersistenceBrokerFactoryClass=org.apache.ojb.broker.core.PersistenceBrokerFactoryDefaultImpl
#
# The PersistenceBrokerClass entry decides which concrete PersistenceBroker
# implementation is to be served by the PersistenceBrokerFactory.
# This is the singlevm implementation:
PersistenceBrokerClass=org.apache.ojb.broker.core.PersistenceBrokerImpl
#
#
#----------------------------------------------------------------------------------------
# PersistenceBrokerFactory pool
#----------------------------------------------------------------------------------------
# PersistenceBroker pool configuration
# This pool uses the jakarta-commons-pool api.
# There you can find things described in detail.
#
# maximum number of brokers that can be borrowed from the
# pool at one time. When non-positive, there is no limit.
maxActive=100
#
# controls the maximum number of brokers that can sit idle in the
# pool (per key) at any time. When non-positive, there is no limit
maxIdle=-1
#
# max time block to get broker instance from pool, after that exception is 
thrown.
# When non-positive, block till last judgement
maxWait=2000
#
# indicates how long the eviction thread should sleep before "runs" of examining
# idle objects. When non-positive, no eviction thread will be launched.
timeBetweenEvictionRunsMillis=-1
#
# specifies the minimum amount of time that an broker may sit idle
# in the pool before it is eligable for eviction due to idle time.
# When non-positive, no object will be dropped from the pool due
# to idle time alone (depends on timeBetweenEvictionRunsMillis > 0)
minEvictableIdleTimeMillis=1000000
#
# specifies the behaviour of the pool when broker capacity is
# exhausted (see maxActive above)
# 0 - fail
# 1 - block
# 2 - grow
whenExhaustedAction=0
#
#
#----------------------------------------------------------------------------------------
# ConnectionFactory / Default ConnectionPool
#----------------------------------------------------------------------------------------
# The ConnectionFactoryClass entry determines which kind of ConnectionFactory
# is to be used within org.apache.ojb as connection factory.
# A ConnectionFactory is responsible for creating
# JDBC Connections. Current version ships four implementations:
#
# 1. ConnectionFactoryNotPooledImpl
#    No pooling, no playing around.
#    Every connection request returns a new connection,
#    every connection release close the connection.
# 2. ConnectionFactoryPooledImpl
#    This implementation supports connection pooling.
# 3. ConnectionFactoryDBCPImpl
#    Using the jakarta-DBCP api for connection management, support
#    connection- and prepared statement-pooling, abandoned connection handling.
# 4. ConnectionFactoryManagedImpl
#    Connection factory for use within managed environments - e.g. JBoss.
#    Every obtained DataSource was wrapped within OJB (and ignore
#    e.g. con.commit() calls within OJB).
#    Use this implementation e.g if you use Datasources from an application 
server.
#
# Use the OJB performance tests to decide, which implementation is best for you.
# The proper way of obtaining a connection is configured in
# JDBCConnectionDescriptor entries in the repository.xml file.
# If want a more fine grained control of each connection pool used by OJB,
# take a look at the repository.dtd, there was a possibility to override
# this default connection factory entry in each JDBCConnectionDescriptor.
#
ConnectionFactoryClass=org.apache.ojb.broker.accesslayer.ConnectionFactoryPooledImpl
#ConnectionFactoryClass=org.apache.ojb.broker.accesslayer.ConnectionFactoryNotPooledImpl
#ConnectionFactoryClass=org.apache.ojb.broker.accesslayer.ConnectionFactoryManagedImpl
#ConnectionFactoryClass=org.apache.ojb.broker.accesslayer.ConnectionFactoryDBCPImpl
#
#
#----------------------------------------------------------------------------------------
# ConnectionManager
#----------------------------------------------------------------------------------------
# The ConnectionManagerClass entry defines the ConnectionManager 
implemementation to be used
ConnectionManagerClass=org.apache.ojb.broker.accesslayer.ConnectionManagerImpl
#
#
#----------------------------------------------------------------------------------------
# SqlGenerator
#----------------------------------------------------------------------------------------
# The SqlGeneratorClass entry defines the SqlGenerator implemementation to be 
used
SqlGeneratorClass=org.apache.ojb.broker.accesslayer.sql.SqlGeneratorDefaultImpl
#
#
#----------------------------------------------------------------------------------------
# CollectionProxy class
#----------------------------------------------------------------------------------------
# The optional CollectionProxy entry defines the class to be used for 
CollectionProxies
# if this entry is null org.apache.ojb.broker.accesslayer.ListProxy is used for 
Lists
# and org.apache.ojb.broker.accesslayer.CollectionProxy for Collections
#
#CollectionProxyClass=
#
#----------------------------------------------------------------------------------------
# StatementManager
#----------------------------------------------------------------------------------------
# The StatementManagerClass entry defines the StatementManager implemementation 
to be used
StatementManagerClass=org.apache.ojb.broker.accesslayer.StatementManager
#
#
#----------------------------------------------------------------------------------------
# JdbcAccess
#----------------------------------------------------------------------------------------
# The JdbcAccessClass entry defines the JdbcAccess implemementation to be used
JdbcAccessClass=org.apache.ojb.broker.accesslayer.JdbcAccessImpl
#
#
#----------------------------------------------------------------------------------------
# Object cache
#----------------------------------------------------------------------------------------
# The ObjectCacheClass entry tells OJB which concrete instance Cache
# implementation is to be used.
ObjectCacheClass=org.apache.ojb.broker.cache.ObjectCacheDefaultImpl
#ObjectCacheClass=org.apache.ojb.broker.cache.ObjectCacheEmptyImpl
#ObjectCacheClass=org.apache.ojb.broker.cache.ObjectCachePerBrokerImpl
#ObjectCacheClass=org.apache.ojb.broker.cache.MetaObjectCacheJCSImpl
#ObjectCacheClass=org.apache.ojb.broker.cache.MetaObjectCachePerClassImpl
#
#
# Use CacheFilters to do filter operations before caching methods were
# called. Build your own filter class by implementing 
org.apache.ojb.cache.CacheFilter.
# It is possible to use a arbitrary number of CacheFilters, but this slows
# down the performance of the cache, thus handle with care.
#
# - org.apache.ojb.broker.cache.CacheFilterClassImpl
# allows filtering of classes
# - org.apache.ojb.broker.cache.CacheFilterPackageImpl
# allows filtering of packages
# More info see Javadoc of the according classes.
# Set a comma separated list of CacheFilter.
#ObjectCacheFilter=org.apache.ojb.broker.cache.CacheFilterClassImpl,org.apache.ojb.broker.cache.CacheFilterPackageImpl
#
#----------------------------------------------------------------------------------------
# Locking
#----------------------------------------------------------------------------------------
# The LockManagerClass entry tells OJB which concrete LockManager
# implementation is to be used.
LockManagerClass=org.apache.ojb.odmg.locking.LockManagerDefaultImpl
#
# The LockMapClass entry tells OJB which concrete LockMap
# implementation is to be used.
# If OJB is running on multiple concurrent clients it is recommended
# to use the PersistentLockMapImpl. It guarantees to provide
# Lockamanagement across multiple JVMs.
# If OJB is running in a single JVM (e.g. in a desktop app, or in a servlet
# engine) it is save to use the InMemoryLockMapImpl. Using it will result
# in a large performance gain.
# LockMapClass=org.apache.ojb.odmg.locking.PersistentLockMapImpl
LockMapClass=org.apache.ojb.odmg.locking.InMemoryLockMapImpl
#
# The LockTimeout entry defines the maximum time in milliseconds
# that a lock may be hold. Defaults to 60000 = 1 minute
LockTimeout=60000
#
# The ImplicitLocking entry defines if implicit lock acquisition is
# to be used. If set to true OJB implicitely locks objects to ODMG
# transactions after performing OQL queries.
# If implicit locking is used locking objects is recursive, that is
# associated objects are also locked.
# If ImplicitLocking is set to false, no locks are obtained in OQL
# queries and there is also no recursive locking.
ImplicitLocking=true
#ImplicitLocking=false
#
# The LockAssociations entry defines the behaviour for the OJB
# implicit locking feature. If set to WRITE (default) acquiring a write-
# lock on a given object x implies write locks on all objects associated
# to x. If set to READ implicit read-locks are acquired.
# Acquiring a read-lock on x thus allways results in implicit read-locks
# on all associated objects.
#LockAssociations=READ
LockAssociations=WRITE
#
#
#----------------------------------------------------------------------------------------
# Logging
#----------------------------------------------------------------------------------------
# The LoggerClass entry tells OJB which concrete Logger
# implementation is to be used.
#
# Commons-logging
#LoggerClass=org.apache.ojb.broker.util.logging.CommonsLoggerImpl
# log4j based logging
#LoggerClass=org.apache.ojb.broker.util.logging.Log4jLoggerImpl
# OJB's own simple looging support
LoggerClass=org.apache.ojb.broker.util.logging.PoorMansLoggerImpl
LoggerConfigFile=log4j.properties
#
# The LogLevel entries tells OJB which LogLevels are active
# for the different loggers used within OJB
# Loglevels: DEBUG < INFO < WARN < ERROR < FATAL
# That is loglevel WARN won't log DEBUG and INFO messages,
# but will log WARN, ERROR, and FATAL messages
#
# The Default Logger
DEFAULT.LogLevel=INFO
# Logger for PersistenceBrokerImpl class
org.apache.ojb.broker.core.PersistenceBrokerImpl.LogLevel=WARN
# Logger for PersistenceBrokerFactory class
org.apache.ojb.broker.PersistenceBrokerFactory.LogLevel=WARN
# Logger for RepositoryXmlHandler, useful for debugging parsing of 
repository.xml!
org.apache.ojb.broker.metadata.RepositoryXmlHandler.LogLevel=WARN
# Logger for JdbcAccess, useful for debugging JDBC related problems
org.apache.ojb.broker.accesslayer.JdbcAccess.LogLevel=WARN
# Logger for RsIterator, useful for debugging problems with Object 
materialization
org.apache.ojb.broker.accesslayer.RsIterator.LogLevel=WARN
# Logger for StatementsForClass, useful for debugging JDBC Connection related 
problems
org.apache.ojb.broker.accesslayer.StatementsForClass.LogLevel=WARN
# Logger for SqlGenerator, useful for debugging generation of SQL
org.apache.ojb.broker.accesslayer.sql.SqlGeneratorDefaultImpl.LogLevel=WARN
# Logger for RepositoryPersistor
org.apache.ojb.broker.metadata.RepositoryPersistor.LogLevel=WARN
# Logger for PersistenceBrokerFactoryDefaultImpl
org.apache.ojb.broker.core.PersistenceBrokerFactoryDefaultImpl.LogLevel=WARN
# Logger for the ODMG Implementation
ODMG.LogLevel=WARN
# Logger for the JDO RI Implementation
JDO.LogLevel=DEBUG
# Logger for the performance tests
performance.LogLevel=INFO
# Logger for the soda api
soda.LogLevel=WARN
# Logger for the factory service
ConfigurableFactory.LogLevel=WARN
#
#
#----------------------------------------------------------------------------------------
# OQL / SQL settings
#----------------------------------------------------------------------------------------
# The OqlCollectionClass entry defines the collection type returned
# from OQL queries. By default this value is set to DListImpl.
# This will be good for most situations as DList allows maximum flexibility
# in a ODMG environment.
# Using DLists for large resultsets may be bad for application performance.
# For these scenarios you can use ArrayLists or Vectors.
# Important note: the collections class to be used MUST implement the
# interface org.apache.ojb.broker.ManageableCollection.
#
OqlCollectionClass=org.apache.ojb.odmg.collections.DListImpl
# OqlCollectionClass=org.apache.ojb.broker.util.collections.ManageableArrayList
# OqlCollectionClass=org.apache.ojb.broker.util.ManageableVector
#
# The SqlInLimit entry limits the number of values in IN-sql statement,
# -1 for no limits. This hint is used in Criteria.
SqlInLimit=200
#
#
#----------------------------------------------------------------------------------------
# Meta data / mapping settings
#----------------------------------------------------------------------------------------
# The PersistentFieldClass property defines the implementation class
# for PersistentField attributes used in the OJB MetaData layer.
# By default a attribute based Version using Reflection is selected.
# using this Class persistent attributes don't need getters and setters
# and don't have to be declared public or protected.
#
PersistentFieldClass=org.apache.ojb.broker.metadata.fieldaccess.PersistentFieldDefaultImpl
#
# There is also a high-speed version of this access strategy avalaible.
# The PersistentFieldMaxPerformanceImpl does not cooperate with
# an AccessController, but accesses the fields directly.
#PersistentFieldClass=org.apache.ojb.broker.metadata.fieldaccess.PersistentFieldMaxPerformanceImpl
#
# The PersistentFieldPropertyImpl uses JavaBeans comformant calls only
# to access persistent attributes. No Reflection is needed.
# But for each attribute xxx there must be public getXxx() and setXxx() methods.
#
#PersistentFieldClass=org.apache.ojb.broker.metadata.fieldaccess.PersistentFieldPropertyImpl
#
#
#----------------------------------------------------------------------------------------
# Component Intercepting for Profiling and Tracing
#----------------------------------------------------------------------------------------
# By enabling an InterceptorClass all OJB components will use
# this Interceptor. Interceptors allow advanced tracing and Profiling
# of all component method calls.
# This is currently an experimental feature useful only for OJB kernel 
developers.
#
#InterceptorClass=org.apache.ojb.broker.util.interceptor.TracingInterceptor
#
#----------------------------------------------------------------------------------------
# Transaction Management and assocation
#----------------------------------------------------------------------------------------
# Use the LocalTxManager if you want the transaction to be associated by a 
thread
OJBTxManagerClass=org.apache.ojb.odmg.LocalTxManager
# Use the JTATxManager if you want the transaction to be associated via the 
Transaction
# manager that is in your application server.
#OJBTxManagerClass=org.apache.ojb.odmg.JTATxManager
#
# The TransactionManager is acquired in different ways dependent on the 
application server.
# The JTATransactionManagerClass property allows you to specify the class that 
implements
# the proper behaviour for finding the transaction manager. Only use when 
OJBTxManagerClass
# is set to a factory that uses the application server transaction manager
# (org.apache.ojb.odmg.JTATxManager)
#
# JBoss Transaction Manager Factory
JTATransactionManagerClass=org.apache.ojb.odmg.transaction.JBossTransactionManagerFactory
# Weblogic Transaction Manager Factory
#JTATransactionManagerClass=org.apache.ojb.odmg.transaction.WeblogicTransactionManagerFactory
# WebSphere transaction manager factory
#JTATransactionManagerClass=org.apache.ojb.odmg.transaction.WebSphereTransactionManagerFactory
# Orion transaction manager factory
#JTATransactionManagerClass=org.apache.ojb.odmg.transaction.OrionTransactionManagerFactory
#
#----------------------------------------------------------------------------------------
# End of OJB.properties file
#----------------------------------------------------------------------------------------
DROP TABLE IDENTITY_;
CREATE TABLE IDENTITY_ (
        ID      CHAR(25) PRIMARY KEY,
        STATE   INT,
        PREFERRED_ID CHAR(25),
        UNIQUE (ID)
);
CREATE INDEX IDENTITY_IDX ON IDENTITY_(ID);
DROP TABLE TRAIT_;
CREATE TABLE TRAIT_ (
        TRAIT_ID VARCHAR(255) NOT NULL,
        ID CHAR(20),
        TYPE_ CHAR(20),
        NAME CHAR(25),
        PARENT_ID VARCHAR(255),
        VALUE CHAR(150),
        BVALUE BYTEA,
        STATE INT,
        CREATEDATE CHAR(25),
        PRIMARY KEY(TRAIT_ID ),
        UNIQUE (TRAIT_ID )
);
CREATE INDEX TRAIT_IDX ON TRAIT_(TRAIT_ID);
CREATE INDEX PARENT_IDX ON TRAIT_(PARENT_ID);
CREATE INDEX ID_IDX ON IDENTITY_(ID);
CREATE INDEX STATE_IDX ON IDENTITY_(STATE);


DROP TABLE OJB_HL_SEQ;
CREATE TABLE OJB_HL_SEQ (
  TABLENAME    VARCHAR(175) NOT NULL,
  FIELDNAME    VARCHAR(70) NOT NULL,
  MAX_KEY      INT,
  GRAB_SIZE    INT,
  VERSION       INT,
  PRIMARY KEY (TABLENAME, FIELDNAME)
);


DROP TABLE OJB_NRM;
CREATE TABLE OJB_NRM (
    NAME         CHAR(250) NOT NULL PRIMARY KEY,
    OID_          TEXT
  );
CREATE INDEX OJB_NRM_IDX ON OJB_NRM( NAME );

DROP TABLE OJB_DLIST;
CREATE TABLE OJB_DLIST (
    ID          INT NOT NULL PRIMARY KEY,
    SIZE_        INT
);
CREATE INDEX OJB_DLIST_IDX ON OJB_DLIST(ID);

DROP TABLE OJB_DLIST_ENTRIES;
CREATE TABLE OJB_DLIST_ENTRIES (
    ID          INT NOT NULL PRIMARY KEY,
    DLIST_ID    INT NOT NULL,
    POSITION_    INT,
    OID_         TEXT
);
CREATE INDEX OJB_DLIST_ENTRIES_IDX ON OJB_DLIST_ENTRIES(ID);
DROP TABLE OJB_DSET;
CREATE TABLE OJB_DSET (
    ID          INT NOT NULL PRIMARY KEY,
    SIZE_        INT
);
CREATE INDEX OJB_DSET_IDX ON OJB_DSET(ID);

DROP TABLE OJB_DSET_ENTRIES;
CREATE TABLE OJB_DSET_ENTRIES (
    ID          INT NOT NULL PRIMARY KEY,
    DLIST_ID    INT NOT NULL,
    POSITION_    INT,
    OID_         TEXT
);
CREATE INDEX OJB_DSET_ENTRIES_IDX ON OJB_DSET_ENTRIES(ID);

DROP TABLE OJB_DMAP;
CREATE TABLE OJB_DMAP (
    ID          INT NOT NULL PRIMARY KEY,
    SIZE_        INT
);
CREATE INDEX OJB_DMAP_IDX ON OJB_DMAP(ID);

DROP TABLE OJB_DMAP_ENTRIES;
CREATE TABLE OJB_DMAP_ENTRIES (
    ID          INT NOT NULL PRIMARY KEY,
    DMAP_ID     INT NOT NULL,
    KEY_OID     TEXT,
    VALUE_OID   TEXT
);
CREATE INDEX OJB_DMAP_ENTRIES_IDX ON OJB_DMAP_ENTRIES(ID);

<?xml version='1.0' ?>
<!-- defining entities for include-files -->
<!DOCTYPE descriptor-repository SYSTEM "repository.dtd" [
<!ENTITY user SYSTEM "repository_user.xml">
<!ENTITY junit SYSTEM "repository_junit.xml">
<!ENTITY internal SYSTEM "repository_internal.xml">
]>

<!--This is a sample metadata repository for the ObJectBridge System.
It maps Pids classes to a instantdb database.
-->
<descriptor-repository version="1.0" isolation-level="read-uncommitted">


  <jdbc-connection-descriptor 
        jcd-alias="postgresql-pids"
        default-connection="true"
        username="openemed" 
        dbalias="//localhost/pids" 
        platform="postgresql"   
        driver="org.postgresql.Driver" 
        subprotocol="postgresql" 
        protocol="jdbc" 
        password="openemed"/>
  
  &user;   

  &internal;    

</descriptor-repository>

reply via email to

[Prev in Thread] Current Thread [Next in Thread]