open class BeanFactoryDataSourceLookup : DataSourceLookup, BeanFactoryAware
DataSourceLookup implementation based on a Spring BeanFactory. Will lookup Spring managed beans identified by bean name, expecting them to be of type |
|
open class IsolationLevelDataSourceRouter : AbstractRoutingDataSource
DataSource that routes to one of various target DataSources based on the current transaction isolation level. The target DataSources need to be configured with the isolation level name as key, as defined on the org.springframework.transaction.TransactionDefinition. This is particularly useful in combination with JTA transaction management (typically through Spring's org.springframework.transaction.jta.JtaTransactionManager). Standard JTA does not support transaction-specific isolation levels. Some JTA providers support isolation levels as a vendor-specific extension (e.g. WebLogic), which is the preferred way of addressing this. As alternative (e.g. on WebSphere), the target database can be represented through multiple JNDI DataSources, each configured with a different isolation level (for the entire DataSource). The present DataSource router allows to transparently switch to the appropriate DataSource based on the current transaction's isolation level. The configuration can for example look like this, assuming that the target DataSources are defined as individual Spring beans with names "myRepeatableReadDataSource", "mySerializableDataSource" and "myDefaultDataSource": Alternatively, the keyed values can also be data source names, to be resolved through a DataSourceLookup: by default, JNDI names for a standard JNDI lookup. This allows for a single concise definition without the need for separate DataSource bean definitions. Note: If you are using this router in combination with Spring's org.springframework.transaction.jta.JtaTransactionManager, don't forget to switch the "allowCustomIsolationLevels" flag to "true". (By default, JtaTransactionManager will only accept a default isolation level because of the lack of isolation level support in standard JTA itself.)
|
|
open class JndiDataSourceLookup : JndiLocatorSupport, DataSourceLookup
JNDI-based DataSourceLookup implementation. For specific JNDI configuration, it is recommended to configure the "jndiEnvironment"/"jndiTemplate" properties. |
|
open class MapDataSourceLookup : DataSourceLookup
Simple DataSourceLookup implementation that relies on a map for doing lookups. Useful for testing environments or applications that need to match arbitrary String names to target DataSource objects. |
|
open class SingleDataSourceLookup : DataSourceLookup
An implementation of the DataSourceLookup that simply wraps a single given DataSource, returned for any data source name. |
open class DataSourceLookupFailureException : NonTransientDataAccessException
Exception to be thrown by a DataSourceLookup implementation, indicating that the specified DataSource could not be obtained. |