Advertisement
Guest User

entityengine.xml

a guest
Nov 2nd, 2016
176
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 13.48 KB | None | 0 0
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!--
  3. Licensed to the Apache Software Foundation (ASF) under one
  4. or more contributor license agreements.  See the NOTICE file
  5. distributed with this work for additional information
  6. regarding copyright ownership.  The ASF licenses this file
  7. to you under the Apache License, Version 2.0 (the
  8. "License"); you may not use this file except in compliance
  9. with the License.  You may obtain a copy of the License at
  10.  
  11. http://www.apache.org/licenses/LICENSE-2.0
  12.  
  13. Unless required by applicable law or agreed to in writing,
  14. software distributed under the License is distributed on an
  15. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  16. KIND, either express or implied.  See the License for the
  17. specific language governing permissions and limitations
  18. under the License.
  19. -->
  20. <!--
  21. - This file configures the Entity Engine JDBC (or other DataSource) and JTA
  22. access. For a detailed description see the core/docs/entityconfig.html file.
  23. -->
  24. <entity-config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  25.        xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/entity-config.xsd">
  26.     <resource-loader name="fieldfile" class="org.ofbiz.base.config.FileLoader"
  27.            prepend-env="ofbiz.home" prefix="/framework/entity/fieldtype/"/>
  28.  
  29.     <!-- the transaction factory class to use, one is needed for each way of getting JTA interfaces -->
  30.     <!-- Use this one for Geronimo -->
  31.     <transaction-factory class="org.ofbiz.geronimo.GeronimoTransactionFactory"/>
  32.  
  33.     <!-- Use this one for getting the JTA objects from JNDI -->
  34.     <!-- NOTE: to use the JndiFactory you must specify the necessary JNDI properties
  35.    <transaction-factory class="org.ofbiz.entity.transaction.JNDIFactory">
  36.        <user-transaction-jndi jndi-server-name="default" jndi-name="java:comp/UserTransaction"/>
  37.        <transaction-manager-jndi jndi-server-name="default" jndi-name="java:comp/UserTransaction"/>
  38.    </transaction-factory>
  39.    -->
  40.     <!--
  41.        It is common to use UserTransaction for the TransactionManager, but if that doesn't work, try this: <transaction-manager-jndi jndi-server-name="default" jndi-name="java:comp/TransactionManager"/>
  42.        Common UserTransaction locations:
  43.            java:comp/UserTransaction (most servers: Resin, Orion, OC4J, etc)
  44.            UserTransaction (RexIP)
  45.        JBoss uses two different objects for the UserTransaction and TransactionManager interfaces;
  46.        they are located in JNDI at: "java:comp/UserTransaction" and "java:/TransactionManager" respectively
  47.    -->
  48.  
  49.     <!-- the connection factory class to use, one is needed for obtaining connections/pools for defined resources -->
  50.     <connection-factory class="org.ofbiz.entity.connection.DBCPConnectionFactory"/>
  51.  
  52.     <debug-xa-resources value="false" />  <!-- see https://issues.apache.org/jira/browse/OFBIZ-4282 for more -->
  53.    
  54.     <delegator name="default"
  55.     entity-model-reader="main"
  56.     entity-group-reader="main"
  57.     entity-eca-reader="main"
  58.     distributed-cache-clear-enabled="false">
  59.         <group-map group-name="org.ofbiz" datasource-name="localcassandra"/>
  60.         <group-map group-name="org.ofbiz.olap" datasource-name="localcassandra"/>
  61.         <group-map group-name="org.ofbiz.tenant" datasource-name="localcassandra"/>
  62.     </delegator>
  63.     <delegator name="default-no-eca" entity-model-reader="main" entity-group-reader="main" entity-eca-reader="main" entity-eca-enabled="false" distributed-cache-clear-enabled="false">
  64.         <group-map group-name="org.ofbiz" datasource-name="localcassandra"/>
  65.         <group-map group-name="org.ofbiz.olap" datasource-name="localcassandra"/>
  66.         <group-map group-name="org.ofbiz.tenant" datasource-name="localcassandra"/>
  67.     </delegator>
  68.  
  69.     <!-- be sure that your default delegator (or the one you use) uses the same datasource for test. You must run "ant load-demo" before running "ant run-tests" -->
  70.     <delegator name="test" entity-model-reader="main" entity-group-reader="main" entity-eca-reader="main">
  71.         <group-map group-name="org.ofbiz" datasource-name="localcassandra"/>
  72.         <group-map group-name="org.ofbiz.olap" datasource-name="localcassandra"/>
  73.         <group-map group-name="org.ofbiz.tenant" datasource-name="localcassandra"/>
  74.     </delegator>
  75.    
  76.     <!-- need to at least define a name for each component to use -->
  77.     <entity-model-reader name="main"/>
  78.  
  79.     <!-- need to at least define a name for each component to use -->
  80.     <entity-group-reader name="main"/>
  81.  
  82.     <!-- need to at least define a name for each component to use -->
  83.     <entity-eca-reader name="main"/>
  84.  
  85.     <!-- need to at least define a name for each component to use -->
  86.     <!-- defining:
  87.        tenant       = OFBiz and External Tenant Data
  88.        seed         = OFBiz and External Seed Data - to be maintained along with source and updated whenever a system deployment is updated
  89.        seed-initial = OFBiz and External Seed Data - to be maintained along with source like other seed data, but only loaded initially and not updated when a system is updated except manually reviewing each line
  90.        demo         = OFBiz Only Demo Data
  91.        ext          = External General Data (custom)
  92.        ext-test     = External Test Data (custom)
  93.        ext-demo     = External Demo Data (custom)
  94.    -->
  95.     <entity-data-reader name="tenant"/>
  96.     <entity-data-reader name="seed"/>
  97.     <entity-data-reader name="seed-initial"/>
  98.     <entity-data-reader name="demo"/>
  99.     <entity-data-reader name="ext"/>
  100.     <entity-data-reader name="ext-test"/>
  101.     <entity-data-reader name="ext-demo"/>
  102.  
  103.     <field-type name="hsql" loader="fieldfile" location="fieldtypehsql.xml"/>
  104.     <field-type name="derby" loader="fieldfile" location="fieldtypederby.xml"/>
  105.     <field-type name="daffodil" loader="fieldfile" location="fieldtypedaffodil.xml"/>
  106.     <field-type name="axion" loader="fieldfile" location="fieldtypeaxion.xml"/>
  107.     <field-type name="mysql" loader="fieldfile" location="fieldtypemysql.xml"/>
  108.     <field-type name="postgres" loader="fieldfile" location="fieldtypepostgres.xml"/>
  109.     <field-type name="postnew" loader="fieldfile" location="fieldtypepostnew.xml"/>
  110.     <field-type name="oracle" loader="fieldfile" location="fieldtypeoracle.xml"/>
  111.     <field-type name="sapdb" loader="fieldfile" location="fieldtypesapdb.xml"/>
  112.     <field-type name="sybase" loader="fieldfile" location="fieldtypesybase.xml"/>
  113.     <field-type name="firebird" loader="fieldfile" location="fieldtypefirebird.xml"/>
  114.     <field-type name="mssql" loader="fieldfile" location="fieldtypemssql.xml"/>
  115.     <field-type name="advantage" loader="fieldfile" location="fieldtypeadvantage.xml"/>
  116.     <field-type name="cassandra" loader="fieldfile" location="fieldtypecassandra.xml"/>
  117.    
  118.     <!--
  119.    For DAO/JDBC Helper: Tries:
  120.      1. JNDI Datasource IF jdbc.jndi.name, context.provider, etc are specified
  121.      2. Embedded (JOTM) if available (uses jdbc.driver, jdbc.uri, jdbc.username, jdbc.password, isolation.level)
  122.      3. Direct to manually laoded JDBC driver (uses jdbc.driver, jdbc.uri, jdbc.username, jdbc.password)
  123.  
  124.    Transaction Isolation Levels - (<helperName>.isolation.level) can be as follows:
  125.     * None
  126.     * ReadCommitted (Recommended)
  127.     * ReadUncommitted
  128.     * RepeatableRead
  129.     * Serializable (NOT Recommended)
  130.     * Not set uses database default
  131.    -->
  132.     <datasource name="localderby"
  133.            helper-class="org.ofbiz.entity.datasource.GenericHelperDAO"
  134.            schema-name="OFBIZ"
  135.            field-type-name="derby"
  136.            check-on-start="true"
  137.            add-missing-on-start="true"
  138.            use-pk-constraint-names="false"
  139.            use-indices-unique="false"
  140.            alias-view-columns="false"
  141.            use-order-by-nulls="true"
  142.            offset-style="fetch">
  143.         <read-data reader-name="tenant"/>
  144.         <read-data reader-name="seed"/>
  145.         <read-data reader-name="seed-initial"/>
  146.         <read-data reader-name="demo"/>
  147.         <read-data reader-name="ext"/>
  148.         <read-data reader-name="ext-test"/>
  149.         <read-data reader-name="ext-demo"/>
  150.         <!-- beware use-indices-unique="false" is needed because of Derby bug with null values in a unique index -->
  151.         <inline-jdbc
  152.                jdbc-driver="org.apache.derby.jdbc.EmbeddedDriver"
  153.                jdbc-uri="jdbc:derby:ofbiz;create=true"
  154.                jdbc-username="ofbiz"
  155.                jdbc-password-lookup="derby-ofbiz"
  156.                isolation-level="ReadCommitted"
  157.                pool-minsize="2"
  158.                pool-maxsize="250"
  159.                time-between-eviction-runs-millis="600000"/>
  160.         <!-- <jndi-jdbc jndi-server-name="localjndi" jndi-name="java:/DerbyDataSource" isolation-level="ReadCommitted"/> -->
  161.     </datasource>
  162.     <datasource name="localderbyodbc"
  163.        helper-class="org.ofbiz.entity.datasource.GenericHelperDAO"
  164.        schema-name="OFBIZ"
  165.        field-type-name="derby"
  166.        check-on-start="true"
  167.        add-missing-on-start="true"
  168.        use-pk-constraint-names="false"
  169.        use-indices-unique="false"
  170.        alias-view-columns="false"
  171.        use-order-by-nulls="true"
  172.        offset-style="fetch">
  173.         <!-- beware use-indices-unique="false" is needed because of Derby bug with null values in a unique index -->
  174.         <inline-jdbc
  175.            jdbc-driver="org.apache.derby.jdbc.EmbeddedDriver"
  176.            jdbc-uri="jdbc:derby:ofbizodbc;create=true"
  177.            jdbc-username="ofbiz"
  178.            jdbc-password-lookup="derby-ofbizodbc"
  179.            isolation-level="ReadCommitted"
  180.            pool-minsize="2"
  181.            pool-maxsize="250"
  182.                time-between-eviction-runs-millis="600000"/>
  183.         <!-- <jndi-jdbc jndi-server-name="localjndi" jndi-name="java:/DerbyDataSource" isolation-level="ReadCommitted"/> -->
  184.     </datasource>
  185.     <datasource name="localderbyolap"
  186.            helper-class="org.ofbiz.entity.datasource.GenericHelperDAO"
  187.            schema-name="OFBIZ"
  188.            field-type-name="derby"
  189.            check-on-start="true"
  190.            add-missing-on-start="true"
  191.            use-pk-constraint-names="false"
  192.            use-indices-unique="false"
  193.            alias-view-columns="false"
  194.            use-order-by-nulls="true">
  195.         <!-- beware use-indices-unique="false" is needed because of Derby bug with null values in a unique index -->
  196.         <read-data reader-name="tenant"/>
  197.         <read-data reader-name="seed"/>
  198.         <read-data reader-name="seed-initial"/>
  199.         <read-data reader-name="demo"/>
  200.         <read-data reader-name="ext"/>
  201.         <read-data reader-name="ext-test"/>
  202.         <read-data reader-name="ext-demo"/>
  203.         <inline-jdbc
  204.                jdbc-driver="org.apache.derby.jdbc.EmbeddedDriver"
  205.                jdbc-uri="jdbc:derby:ofbizolap;create=true"
  206.                jdbc-username="ofbiz"
  207.                jdbc-password-lookup="derby-ofbizolap"
  208.                isolation-level="ReadCommitted"
  209.                pool-minsize="2"
  210.                pool-maxsize="250"
  211.                time-between-eviction-runs-millis="600000"/>
  212.         <!-- <jndi-jdbc jndi-server-name="localjndi" jndi-name="java:/DerbyDataSource" isolation-level="ReadCommitted"/> -->
  213.     </datasource>
  214.     <datasource name="localderbytenant"
  215.        helper-class="org.ofbiz.entity.datasource.GenericHelperDAO"
  216.        schema-name="OFBIZ"
  217.        field-type-name="derby"
  218.        check-on-start="true"
  219.        add-missing-on-start="true"
  220.        use-pk-constraint-names="false"
  221.        use-indices-unique="false"
  222.        alias-view-columns="false"
  223.        use-order-by-nulls="true">
  224.         <read-data reader-name="tenant"/>
  225.         <read-data reader-name="seed"/>
  226.         <read-data reader-name="seed-initial"/>
  227.         <read-data reader-name="demo"/>
  228.         <read-data reader-name="ext"/>
  229.         <read-data reader-name="ext-test"/>
  230.         <read-data reader-name="ext-demo"/>
  231.         <!-- beware use-indices-unique="false" is needed because of Derby bug with null values in a unique index -->
  232.         <inline-jdbc
  233.            jdbc-driver="org.apache.derby.jdbc.EmbeddedDriver"
  234.            jdbc-uri="jdbc:derby:ofbiztenant;create=true"
  235.            jdbc-username="ofbiz"
  236.            jdbc-password-lookup="derby-ofbiztenant"
  237.            isolation-level="ReadCommitted"
  238.            pool-minsize="2"
  239.            pool-maxsize="250"
  240.            time-between-eviction-runs-millis="600000"/>
  241.         <!-- <jndi-jdbc jndi-server-name="localjndi" jndi-name="java:/DerbyDataSource" isolation-level="ReadCommitted"/> -->
  242.     </datasource>
  243.    
  244.     <datasource name="localcassandra"
  245.                 helper-class="org.ofbiz.entity.datasource.GenericHelperDAO"
  246.                 schema-name="OFBIZ"
  247.                 field-type-name="cassandra"
  248.                 check-on-start="true"
  249.                 add-missing-on-start="true"
  250.                 use-pk-constraint-names="false"
  251.                 use-indices-unique="false"
  252.                 alias-view-columns="false"
  253.                 use-order-by-nulls="true"
  254.                 offset-style="fetch">
  255.             <read-data reader-name="tenant"/>
  256.             <read-data reader-name="seed"/>
  257.             <read-data reader-name="seed-initial"/>
  258.             <read-data reader-name="demo"/>
  259.             <read-data reader-name="ext"/>
  260.             <read-data reader-name="ext-test"/>
  261.             <read-data reader-name="ext-demo"/>
  262.             <inline-jdbc
  263.                     jdbc-driver="org.apache.cassandra.jdbc.EmbeddedDriver"
  264.                     jdbc-uri="jdbc:cassandra://127.0.0.1/ofbiz"
  265.                     jdbc-username="root"
  266.                     jdbc-password=""
  267.                     isolation-level="ReadCommitted"
  268.                     pool-minsize="2"
  269.                     pool-maxsize="250"
  270.                     time-between-eviction-runs-millis="600000"/>
  271.     </datasource>
  272.    
  273. </entity-config>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement