<!-- @version $Id: repository_database.xml,v 1.22.2.7 2005/03/11 14:46:49 arminw Exp $ -->

<!--
#/* Copyright 2002-2004 The Apache Software Foundation
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     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.
 */
-->
<!--
Define here all used connections.
One defined connection should be defined as the default one,
by set default-connection="true" - this could be done at runtime too.

It is possible to set user/password at
runtime or let login different users at runtime using the same
database. Use different PBKey with same jcdAlias name but
different user/password.

Ditto it is possible to add jdbc-connection-descriptor at runtime
using the MetadataManager.
-->

    <!-- this connection was used as the default one within OJB -->
    <jdbc-connection-descriptor
   		jcd-alias="@JCD_ALIAS@"
   		default-connection="true"
   		platform="@DBMS_NAME@"
   		jdbc-level="@JDBC_LEVEL@"
   		driver="@DRIVER_NAME@"
   		protocol="@URL_PROTOCOL@"
   		subprotocol="@URL_SUBPROTOCOL@"
   		dbalias="@URL_DBALIAS@"
   		username="@USER_NAME@"
   		password="@USER_PASSWD@"
   		batch-mode="false"
        useAutoCommit="1"
        ignoreAutoCommitExceptions="false"
     >

        <!-- alternative cache implementations, see docs section "Caching" -->
        <object-cache class="org.apache.ojb.broker.cache.ObjectCacheTwoLevelImpl">
            <!-- meaning of attributes, please see docs section "Caching" -->
            <!-- common attributes -->
            <attribute attribute-name="cacheExcludes" attribute-value=""/>
            <!-- ObjectCacheTwoLevelImpl attributes -->
            <attribute attribute-name="applicationCache" attribute-value="org.apache.ojb.broker.cache.ObjectCacheDefaultImpl"/>
            <attribute attribute-name="copyStrategy" attribute-value="org.apache.ojb.broker.cache.ObjectCacheTwoLevelImpl$CopyStrategyImpl"/>
            <!-- ObjectCacheDefaultImpl attributes -->
            <attribute attribute-name="timeout" attribute-value="900"/>
            <attribute attribute-name="autoSync" attribute-value="true"/>
            <attribute attribute-name="cachingKeyType" attribute-value="0"/>
            <attribute attribute-name="useSoftReferences" attribute-value="true"/>
        </object-cache>

        <!-- more info, see section "Connection Handling" in docs -->
        <connection-pool
            maxActive="30"
            validationQuery="@VALIDATION_QUERY@"
            testOnBorrow="@TEST_ON_BORROW@"
            testOnReturn="@TEST_ON_RETURN@"
            whenExhaustedAction="0"
            maxWait="10000"
        />

        <!-- alternative sequence manager implementations, see docs section "Sequence Manager" -->
        <sequence-manager className="org.apache.ojb.broker.util.sequence.SequenceManagerHighLowImpl">
            <!-- meaning of attributes, please see docs section "Sequence Manager" -->
            <attribute attribute-name="grabSize" attribute-value="20"/>
            <attribute attribute-name="autoNaming" attribute-value="true"/>
            <attribute attribute-name="sequenceStart" attribute-value="0"/>
            <attribute attribute-name="globalSequenceId" attribute-value="false"/>
        </sequence-manager>
   </jdbc-connection-descriptor>

   <!-- Datasource example -->
    <!-- jdbc-connection-descriptor
        jcd-alias="default"
        default-connection="true"
   		platform="Hsqldb"
   		jdbc-level="2.0"
   		jndi-datasource-name="java:DefaultDS"
   		username="sa"
   		password=""
        batch-mode="false"
        useAutoCommit="0"
        ignoreAutoCommitExceptions="false"
   >
        <object-cache class="org.apache.ojb.broker.cache.ObjectCacheDefaultImpl">
            <attribute attribute-name="cacheExcludes" attribute-value=""/>
            <attribute attribute-name="timeout" attribute-value="900"/>
            <attribute attribute-name="autoSync" attribute-value="true"/>
            <attribute attribute-name="cachingKeyType" attribute-value="0"/>
        </object-cache>

        <sequence-manager className="org.apache.ojb.broker.util.sequence.SequenceManagerNextValImpl">
            <attribute attribute-name="autoNaming" attribute-value="true"/>
        </sequence-manager>

   </jdbc-connection-descriptor -->

