0

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -->

<!-- the transaction factory class to use, one is needed for each way of getting JTA interfaces -->
<!-- Use this one for Geronimo -->
<transaction-factory class="org.apache.ofbiz.entity.transaction.GeronimoTransactionFactory"/>

<!-- Use this one for getting the JTA objects from JNDI -->
<!-- NOTE: to use the JndiFactory you must specify the necessary JNDI properties
<transaction-factory class="org.apache.ofbiz.entity.transaction.JNDITransactionFactory">
    <user-transaction-jndi jndi-server-name="default" jndi-name="java:comp/UserTransaction"/>
    <transaction-manager-jndi jndi-server-name="default" jndi-name="java:comp/UserTransaction"/>
</transaction-factory>
-->
<!--
    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"/>
    Common UserTransaction locations:
        java:comp/UserTransaction (most servers: Resin, Orion, OC4J, etc)
        UserTransaction (RexIP)
    JBoss uses two different objects for the UserTransaction and TransactionManager interfaces;
    they are located in JNDI at: "java:comp/UserTransaction" and "java:/TransactionManager" respectively
-->

<!-- the connection factory class to use, one is needed for obtaining connections/pools for defined resources -->
<connection-factory class="org.apache.ofbiz.entity.connection.DBCPConnectionFactory"/>

<debug-xa-resources value="false" />  <!-- see https://issues.apache.org/jira/browse/OFBIZ-4282 for more -->

<delegator name="default" entity-model-reader="main" entity-group-reader="main" entity-eca-reader="main" distributed-cache-clear-enabled="false">
    <group-map group-name="org.apache.ofbiz" datasource-name="localmssql"/>
    <group-map group-name="org.apache.ofbiz.olap" datasource-name="localmssql"/>
    <group-map group-name="org.apache.ofbiz.tenant" datasource-name="localmssql"/>
</delegator>
<!-- May be used when you create a service that manages many data for massive imports, this for performance reason or to escape functional cases --> 
<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">
    <group-map group-name="org.apache.ofbiz" datasource-name="localmssql"/>
    <group-map group-name="org.apache.ofbiz.olap" datasource-name="localmssql"/>
    <group-map group-name="org.apache.ofbiz.tenant" datasource-name="localmssql"/>
</delegator>

<!-- Be sure that your default delegator (or the one you use) uses the same datasource for test. You must run "gradlew loadAll" before running "gradlew testIntegration" -->
<delegator name="test" entity-model-reader="main" entity-group-reader="main" entity-eca-reader="main">
    <group-map group-name="org.apache.ofbiz" datasource-name="localmssql"/>
    <group-map group-name="org.apache.ofbiz.olap" datasource-name="localmssql"/>
    <group-map group-name="org.apache.ofbiz.tenant" datasource-name="localmssql"/>
</delegator>

<!-- need to at least define a name for each component to use -->
<entity-model-reader name="main"/>

<!-- need to at least define a name for each component to use -->
<entity-group-reader name="main"/>

<!-- need to at least define a name for each component to use -->
<entity-eca-reader name="main"/>

<!-- need to at least define a name for each component to use -->
<!-- defining:
    tenant       = OFBiz and External Tenant Data
    seed         = OFBiz and External Seed Data - to be maintained along with source and updated whenever a system deployment is updated
    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
    demo         = OFBiz Only Demo Data
    ext          = External General Data (custom)
    ext-test     = External Test Data (custom)
    ext-demo     = External Demo Data (custom)
-->
<entity-data-reader name="tenant"/>
<entity-data-reader name="seed"/>
<entity-data-reader name="seed-initial"/>
<entity-data-reader name="demo"/>
<entity-data-reader name="ext"/>
<entity-data-reader name="ext-test"/>
<entity-data-reader name="ext-demo"/>


<field-type name="mssql" loader="fieldfile" location="fieldtypemssql.xml"/>


<!--
For DAO/JDBC Helper: Tries:
  1. JNDI Datasource IF jdbc.jndi.name, context.provider, etc are specified
  2. Embedded (JOTM) if available (uses jdbc.driver, jdbc.uri, jdbc.username, jdbc.password, isolation.level)
  3. Direct to manually laoded JDBC driver (uses jdbc.driver, jdbc.uri, jdbc.username, jdbc.password)

Transaction Isolation Levels - (<helperName>.isolation.level) can be as follows:
 * None
 * ReadCommitted (Recommended)
 * ReadUncommitted
 * RepeatableRead
 * Serializable (NOT Recommended)
 * Not set uses database default
-->


<datasource name="localmssql"
        helper-class="org.apache.ofbiz.entity.datasource.GenericHelperDAO"
        schema-name="dbo"
        field-type-name="mssql"
        check-on-start="true"
        add-missing-on-start="true"
        join-style="ansi"
        alias-view-columns="false"
        use-fk-initially-deferred="false">
    <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.microsoft.sqlserver.jdbc.SQLServerDriver"
            jdbc-uri="jdbc:sqlserver://127.0.0.1:1433;databaseName=ofbiz;SelectMethod=cursor;"
            jdbc-username="ofbiz"
            jdbc-password="ofbiz"
            isolation-level="ReadCommitted"
            pool-minsize="2"
            pool-maxsize="250"
            time-between-eviction-runs-millis="600000"/>
    <!-- <jndi-jdbc jndi-server-name="default" jndi-name="comp/env/jdbc/xa/localmssql" isolation-level="ReadCommitted"/> --> <!-- Orion Style JNDI name -->
</datasource>

  • Does, anyone notice about Apache OfBiz is not compatible with MSSQL 2019 due to the SDK and JRE is not compatible. Anyway it is working in MSSQL 2017 but the problem is it did not load all the, Enterface, like Accounting and Other, it only load the Party, BMI. I also notice that out of the 3 databases I has created only one Database has functioned. ofbiz only, the Onther ofbizolap and ofbiztenant functioning. Now is there in wrong with these? – Ikizkenar Üḉgen May 26 '20 at 12:33
  • Is there any additional Code since the two delagator pointing out the two Data Source – Ikizkenar Üḉgen May 26 '20 at 12:37

0 Answers0