|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface ConnectionProvider
Connects to a DataSource to obtain a Connection. The ConnectionProvider is not a caching and neither connection pooling mechanism. The ConnectionProvider exists to perform failover algorithm on multiple DataSources when necessary. One instance per StoreManager (RDBMSManager) is created. Users can provide their own implementation via the extension "org.datanucleus.store.rdbms.connectionprovider"
| Method Summary | |
|---|---|
Connection |
getConnection(DataSource[] ds)
Obtain a connection from the datasources, starting on the first datasource, and if unable to obtain a connection skips to the next one on the list, and try again until the list is exhausted. |
void |
setFailOnError(boolean flag)
Flag if an error causes the operation to thrown an exception, or false to skip to next DataSource. |
| Method Detail |
|---|
void setFailOnError(boolean flag)
flag - true if to fail on error
Connection getConnection(DataSource[] ds)
throws SQLException
ds - the array of datasources. An ordered list of datasources
ds is null, or null if the DataSources has returned
a null as connection
SQLException - in case of error and failOnError is true or the error occurs while obtaining
a connection with the last DataSource on the list
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||