码迷,mamicode.com
首页 > 数据库 > 详细

ofbiz 分开默认数据库

时间:2014-12-17 13:11:34      阅读:229      评论:0      收藏:0      [点我收藏+]

标签:des   style   http   ar   io   os   for   java   on   

1 web.xml

<context-param>
    <param-name>entityDelegatorName</param-name>
    <param-value>default</param-value>
    <description>The Name of the Entity Delegator to use, defined in entityengine.xml</description>
</context-param>

在default 改自己定义的Delegator??oeasy

2 entityengine.xml自定义Delegator??oeasy

<delegator name="oeasy" entity-model-reader="main" entity-group-reader="main" entity-eca-reader="main" distributed-cache-clear-enabled="false">
    <group-map group-name="org.ofbiz" datasource-name="ofbiz_mysql"/>
    <group-map group-name="org.ofbiz.olap" datasource-name="ofbiz_mysql"/>
    <group-map group-name="org.ofbiz.tenant" datasource-name="ofbiz_mysql"/>
</delegator>

3 定义个数据原 ofbiz_mysql

<datasource name="ofbiz_mysql"
        helper-class="org.ofbiz.entity.datasource.GenericHelperDAO"
        field-type-name="mysql"
        check-on-start="true"
        add-missing-on-start="true"
        check-pks-on-start="false"
        use-foreign-keys="true"
        join-style="ansi-no-parenthesis"
        alias-view-columns="false"
        drop-fk-use-foreign-key-keyword="true"
        table-type="InnoDB"
        character-set="utf8"
        collate="utf8_general_ci">
    <read-data reader-name="tenant"/>
    <read-data reader-name="seed"/>
    <read-data reader-name="seed-initial"/>
    <read-data reader-name="demo"/>
    <read-data reader-name="ext"/>
    <read-data reader-name="ext-test"/>
    <read-data reader-name="ext-demo"/>
    <inline-jdbc
            jdbc-driver="com.mysql.jdbc.Driver"
            jdbc-uri="jdbc:mysql://localhost/aa?autoReconnect=true"
            jdbc-username="root"
            jdbc-password="123456"
            isolation-level="ReadCommitted"
            pool-minsize="2"
            pool-maxsize="250"
            time-between-eviction-runs-millis="600000"/><!-- Please note that at least one person has experienced a problem with this value with MySQL
            and had to set it to -1 in order to avoid this issue.
            For more look at http://markmail.org/thread/5sivpykv7xkl66px and http://commons.apache.org/dbcp/configuration.html-->
    <!-- <jndi-jdbc jndi-server-name="localjndi" jndi-name="java:/MySqlDataSource" isolation-level="Serializable"/> -->
</datasource>

ofbiz 分开默认数据库

标签:des   style   http   ar   io   os   for   java   on   

原文地址:http://my.oschina.net/u/257088/blog/356963

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!