mirror of https://github.com/apache/openjpa.git
Use username/password for triall connection to slices.
git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@696512 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
05a8f02881
commit
5600a778c9
|
@ -218,7 +218,7 @@ public class DistributedJDBCConfigurationImpl extends JDBCConfigurationImpl
|
||||||
DecoratingDataSource dds = new DecoratingDataSource(ds);
|
DecoratingDataSource dds = new DecoratingDataSource(ds);
|
||||||
ds = DataSourceFactory.installDBDictionary(
|
ds = DataSourceFactory.installDBDictionary(
|
||||||
conf.getDBDictionaryInstance(), dds, conf, false);
|
conf.getDBDictionaryInstance(), dds, conf, false);
|
||||||
if (verifyDataSource(slice, ds)) {
|
if (verifyDataSource(slice, ds, conf)) {
|
||||||
dataSources.add(ds);
|
dataSources.add(ds);
|
||||||
isXA &= isXACompliant(ds);
|
isXA &= isXACompliant(ds);
|
||||||
}
|
}
|
||||||
|
@ -254,10 +254,12 @@ public class DistributedJDBCConfigurationImpl extends JDBCConfigurationImpl
|
||||||
* Verify that a connection can be established to the given slice. If
|
* Verify that a connection can be established to the given slice. If
|
||||||
* connection can not be established then slice is set to INACTIVE state.
|
* connection can not be established then slice is set to INACTIVE state.
|
||||||
*/
|
*/
|
||||||
private boolean verifyDataSource(Slice slice, DataSource ds) {
|
private boolean verifyDataSource(Slice slice, DataSource ds,
|
||||||
|
JDBCConfiguration conf) {
|
||||||
Connection con = null;
|
Connection con = null;
|
||||||
try {
|
try {
|
||||||
con = ds.getConnection();
|
con = ds.getConnection(conf.getConnectionUserName(),
|
||||||
|
conf.getConnectionPassword());
|
||||||
slice.setStatus(Slice.Status.ACTIVE);
|
slice.setStatus(Slice.Status.ACTIVE);
|
||||||
if (con == null) {
|
if (con == null) {
|
||||||
slice.setStatus(Slice.Status.INACTIVE);
|
slice.setStatus(Slice.Status.INACTIVE);
|
||||||
|
|
Loading…
Reference in New Issue