Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Panel

Anchor
context.mxl example
context.mxl example

Example of a context which contains multiple Resource Definitions

Note

In the example below, both the first two Resouce Definitions are identical except for the name property.  
The third Resource Definition differs not only in the name property but also differs in the type property and has a addition factory property.

In .  In general, you can have as many Resource Definitions as you need just as long as each individual Resource Definition has a unique name.

Code Block
<Context antiResourceLocking="true" crossContext="true" useHttpOnly="false">

    <WatchedResource>WEB-INF/web.xml</WatchedResource>

    <Resource name="jdbc/MitsisDs"
        auth="Container"
        type="javax.sql.DataSource"
        driverClassName="oracle.jdbc.OracleDriver"
        url="jdbc:oracle:thin:@//earth-vault-2.mit.edu:1523/sundev2"
        username="mydbusername"
        password="mydbpassword"
        maxActive="20"
        maxIdle="10"
        maxWait="-1"
        removeAbandoned="true"
        removeAbandonedTimeout="30"
        logAbandoned="true" />

    <Resource name="jdbc/ssb"
        auth="Container"
        type="javax.sql.DataSource"
        driverClassName="oracle.jdbc.OracleDriver"
        url="jdbc:oracle:thin:@//earth-vault-2.mit.edu:1523/sundev2"
        username="mydbusername"
        password="mydbpassword"
        maxActive="20"
        maxIdle="10"
        maxWait="-1"
        removeAbandoned="true"
        removeAbandonedTimeout="30"
        logAbandoned="true" />

    <ResourceLink global="jdbc/MitsisDS" name="jdbc/MitsisDS" type="javax.sql.DataSource"/>
    <ResourceLink global="jdbc/ssb" name="jdbc/ssb" type="javax.sql.DataSource"/>

</context>