Good Options for Oracle Datasource - JBoss Middleware
Hi, i am back :)
I would like to demonstrate a sample configuration about Oracle Datasource. Open your domain.xml or standalone*.xml and fill these options below:
(Non-XA Datasource - ojdbc6)
<datasource jta="true" jndi-name="java:/jdbc/<your-jdbc-name>" pool-name="jdbc/<your-jdbc-pool-name>" enabled="true" use-ccm="false"
statistics-enabled="true">
<connection-url>jdbc:oracle:thin:@//localhost:1521/<your-service-name></connection-url>
<driver>oracle</driver>
<transaction-isolation>TRANSACTION_READ_COMMITTED</transaction-isolation>
<pool>
<min-pool-size>6</min-pool-size>
<max-pool-size>10</max-pool-size>
<prefill>true</prefill>
<flush-strategy>IdleConnections</flush-strategy> </pool>
<security>
<user-name>xxxxx</user-name>
<password>yyyyy</password>
</security>
<validation>
<valid-connection-checker class-name="org.jboss.jca.adapters.jdbc.extensions.oracle.OracleValidConnectionChecker"/>
<background-validation>true</background-validation>
<background-validation-millis>60000</background-validation-millis>
<stale-connection-checker class-name="org.jboss.jca.adapters.jdbc.extensions.oracle.OracleStaleConnectionChecker"/>
<exception-sorter class-name="org.jboss.jca.adapters.jdbc.extensions.oracle.OracleExceptionSorter"/>
</validation>
<timeout>
<idle-timeout-minutes>1</idle-timeout-minutes>
</timeout>
<statement>
<prepared-statement-cache-size>100</prepared-statement-cache-size>
<share-prepared-statements>true</share-prepared-statements>
</statement>
</datasource>
...
<drivers>
<driver name="oracle" module="oracle">
<driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
</driver> <driver name="xa-oracle" module="oracle">
<xa-datasource-class>oracle.jdbc.xa.client.OracleXADataSource</xa-datasource-class>
</driver>
</drivers>
To use a good configuration over datasources, you need to know about number of connections...So, how can i set the min and max pool ?
<min-pool-size>6</min-pool-size>
<max-pool-size>10</max-pool-size>
Min-pool-size for a large number of invocations from your applications this option must be set with 60%-70% of the max-pool-size value.
Timeouts and Transaction Isolation are an important configurations too...for example, if you are trying to access data just to show informations in a report, without transaction, please try to use this:
<transaction-isolation>TRANSACTION_SERIALIZABLE</transaction-isolation>
Thanks a lot and see you on the next time...