DBPrism Servlet Engine
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
Global parameters
NameValuesDefault ValueExplanation
classcom.prism.utils.JndiDBPrismConnectionCacheImpl com.prism.oracle.JTADBPrismConnectionCacheImpl com.prism.utils.JdbcDBPrismConnectionCacheImplJdbcDBPrismConnectionCacheImplA valid class name which implements a particular Connection Cache Algorithm. This parameter is mandatory from DBPrism 1.2.0+ . .
timeoutA valid integer interpreted as seconds600Timeout off unused connection, after this value expired the connection is moved to the free list, and then closed.
TxEnabletrue/falsefalseEnable/Disable Transaction support by url demarcation
TxNamesAn space separated list of transaction namesemptyList 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>
NameValuesDefault ValueExplanation
BeginURIa valid URIemptyURL who acts as a begin of the transaction, ej: /servlet/plsql/demo_pkg.Begin_URL
CommitURIa valid URIemptyURL who acts as a commit of the transaction, ej: /servlet/plsql/demo_pkg.Commit_URL
RollBackURIa valid URIemptyURL who acts as a rollback of the transaction, ej: /servlet/plsql/demo_pkg.RollBack_URL
BelongToa ; separeted list of valid URIemptyURIs who belong to the transaction, ej: /servlet/plsql/demo_pkg.*;/servlet/plsql/demo_otherpkg.*
TimeOuta valid positive number500Time 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
NameValuesDefault ValueExplanation
minconnectionsA valid integer value from 0 to n0Minimal numbers of active connections to a database
maxconnectionsA valid integer value from minconnections to n20Maximun numbers of active connections to a database
oracle.JTADBPrismConnectionCacheImpl
This Connection Cache implementation has indepent parameters for every DAD definition defined into DAD section.
NameValuesDefault ValueExplanation
dad.MinLimitA valid integer value from 0 to MaxLimit0Sets 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.MaxLimitA valid integer value from 0 to n20Sets the maximum number of connection instances that the cache can hold.
dad.LoginTimeoutA valid integer value from 0 to n60Specifies 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.CacheSchemeA valid cache schemeFixedWait Deprecated in DBPrism 2.1.2
dad.ValidateConnectiontrue/falsefalseSetting ValidateConnection to true causes the connection cache to test every connection it retrieves against the underlying database.
dad.InitialLimitA valid integer value from 0 to MaxLimit0Sets 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.MaxStatementsLimitA valid integer value from 0 to n0Sets 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
NameValuesDefault ValueExplanation
dbusernameAny valid string for username and passwordempty stringThis 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.
connectStringIgnoredIgnoredDBPrism 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 . Creative Commons License
(C) 1999-2008 - DBPrism ~ DBPrism CMS | Marcelo F. Ochoa | TANDIL ~ Argentina | 2008-10-07T20:16:06
DBPrism at SourceForgeBuilt with Cocoon2