DBPrism Connection Cache
parameters
This section covers aditional parameters used by different implementation of DBPrism Connection Interface. Connection Cache parameters are located inside the section Manager.
These are global parameters under the
section Manager
| Name | Values | Default Value | Explanation |
|---|---|---|---|
| class | com.prism.utils.JndiDBPrismConnectionCacheImpl com.prism.oracle.JTADBPrismConnectionCacheImpl com.prism.utils.JdbcDBPrismConnectionCacheImpl | JdbcDBPrismConnectionCacheImpl | A valid class name which implements a particular Connection Cache Algorithm. This parameter is mandatory from DBPrism 1.2.0+ . . |
| timeout | A valid integer interpreted as seconds | 600 | Timeout off unused connection, after this value expired the connection is moved to the free list, and then closed. |
| TxEnable | true/false | false | Enable/Disable Transaction support by url demarcation |
| TxNames | An space separated list of transaction names | empty | List of space separated TX names. For example "fly demo". |
Transaction Support
Transaction Definitions
This section describes DBPrism Transaction parameters. Remember that Transactions are sections into prism.xconf file starting with the reserved string TX_
Here an example of Transaction by URL demarcation:
<category name="TX_demo">
<property name="BeginURI" value="${demo.path}/m_tx.tx_start"/>
<property name="CommitURI" value="${demo.path}/m_tx.tx_end"/>
<property name="RollBackURI" value="${demo.path}/m_tx.tx_rollback"/>
<property name="BelongTo" value="${demo.path}/m_tx.*"/>
<property name="TimeOut" value="500"/>
</category>
| Name | Values | Default Value | Explanation |
|---|---|---|---|
| BeginURI | a valid URI | empty | URL who acts as a begin of the transaction, ej: /servlet/plsql/demo_pkg.Begin_URL |
| CommitURI | a valid URI | empty | URL who acts as a commit of the transaction, ej: /servlet/plsql/demo_pkg.Commit_URL |
| RollBackURI | a valid URI | empty | URL who acts as a rollback of the transaction, ej: /servlet/plsql/demo_pkg.RollBack_URL |
| BelongTo | a ; separeted list of valid URI | empty | URIs who belong to the transaction, ej: /servlet/plsql/demo_pkg.*;/servlet/plsql/demo_otherpkg.* |
| TimeOut | a valid positive number | 500 | Time out in second after the transaction is automatically rolled back |
Using the Resource Manager, you associate URIs with the operations on transactions (begin, commit, and rollback). When a user invokes one of these URIs, the corresponding transaction operation is performed by the ResourceManager. These URIs can be mapped to stored procedures that display appropriate pages to the user. For example, the begin transaction URI could display to the user a list of items to add to his or her shopping cart, the commit transaction URI could display to the user a list of purchased items, and the rollback transaction URI could display to the user a page that asks if he wants to drop the existing shopping cart and start another one. Between the begin and the commit or rollback URI, the user invokes other URIs that call procedures to perform some action on the database. These procedures might or might not belong to a transaction. If the URI belongs to a transaction, the actions performed by that procedure would be committed or rolled back when the transaction ends. If the URI does not belong to the transaction, it is not affected by the transaction, and Prism treats it as a regular request (changes made by that URI are committed upon completion). URIs belonging to a transaction usually invoke procedures within a package. The sequence of URIs for a stored procedures within the database when invoked would look like the following: -- begin a transaction http://host:port/servlet/demo/test.txn_begin -- the first operation in the transaction http://host:port/servlet/demo/test.txn_update1 -- the second operation in the transaction http://host:port/servlet/demo/test.txn_update2 -- some more operations -- commit the transaction http://host:port/servlet/demo/test.txn_commit
Transactions by URL demarcation are supported
only by JTA and JNDI Connection Cache schemes.
utils.JdbcDBPrismConnectionCacheImpl
formerly ResourceManager
| Name | Values | Default Value | Explanation |
|---|---|---|---|
| minconnections | A valid integer value from 0 to n | 0 | Minimal numbers of active connections to a database |
| maxconnections | A valid integer value from minconnections to n | 20 | Maximun numbers of active connections to a database |
oracle.JTADBPrismConnectionCacheImpl
This Connection Cache implementation has indepent
parameters for every DAD definition defined into
DAD section.
| Name | Values | Default Value | Explanation |
|---|---|---|---|
| dad.MinLimit | A valid integer value from 0 to MaxLimit | 0 | Sets the minimum number of connections the cache maintains. This guarantees that the cache will not shrink below this minimum limit. Setting the MinLimit property does not initialize the cache to contain the minimum number of connections. To do this, use the InitialLimit property. See "InitialLimit". |
| dad.MaxLimit | A valid integer value from 0 to n | 20 | Sets the maximum number of connection instances that the cache can hold. |
| dad.LoginTimeout | A valid integer value from 0 to n | 60 | Specifies cache behavior when a connection is requested and there are already MaxLimit connections active. If ConnectionWaitTimeout is greater than zero (0), each connection request waits for the specified number of seconds, or until a connection is returned to the cache. If no connection is returned to the cache before the timeout elapses, the connection request returns null. |
| dad.CacheScheme | A valid cache scheme | FixedWait | Deprecated in DBPrism 2.1.2 |
| dad.ValidateConnection | true/false | false | Setting ValidateConnection to true causes the connection cache to test every connection it retrieves against the underlying database. |
| dad.InitialLimit | A valid integer value from 0 to MaxLimit | 0 | Sets how many connections are created in the cache
when it is created or reinitialized. When this property is set to
an integer value greater than 0, creating or reinitializing the
cache automatically creates the specified number of connections,
filling the cache in advance of need.
|
| dad.MaxStatementsLimit | A valid integer value from 0 to n | 0 | Sets the maximum number of statements that a connection keeps open. When a cache has this property set, reinitializing the cache or closing the datasource automatically closes all cursors beyond the specified MaxStatementsLimit. |
oracle.JndiDBPrismConnectionCacheImpl
This Connection Cache implementation provides a
simple way to use JNDI datasources defined into
[OC4J_HOME]/config/data-sources.xml file. DBPrism will try to
lookup a DataSource defintion for every DAD defined into
alias parameter.
About parameters into DAD section
| Name | Values | Default Value | Explanation |
|---|---|---|---|
| dbusername | Any valid string for username and password | empty string | This parameter is unused by this Connection Cache implementation, but if you left it in blank DBPrism will try to connect in dynamic mode, that is, DBPrism will prompt the username and password through a browser popup. In the other hand using dynamic mode DBPrism will force to the JNDI DataSources to work in dedication connection mode affecting the performance. To use username and password defined into JNDI Datasources fills username and password with any string values. |
| connectString | Ignored | Ignored | DBPrism ignores this parameter due to its defined into the DataSource parameter. |
This implementation do not support Transactions,
it is planed for production release.
This work is licensed under a
Creative Commons License
.


