Lines 107-112
Link Here
|
107 |
protected String userTable = null; |
107 |
protected String userTable = null; |
108 |
|
108 |
|
109 |
|
109 |
|
|
|
110 |
/** |
111 |
* Last connection attempt. |
112 |
*/ |
113 |
private volatile boolean connectionSuccess = true; |
114 |
|
115 |
|
110 |
// ------------------------------------------------------------- Properties |
116 |
// ------------------------------------------------------------- Properties |
111 |
|
117 |
|
112 |
|
118 |
|
Lines 270-275
Link Here
|
270 |
} |
276 |
} |
271 |
|
277 |
|
272 |
|
278 |
|
|
|
279 |
@Override |
280 |
public boolean isAvailable() { |
281 |
return connectionSuccess; |
282 |
} |
283 |
|
273 |
// -------------------------------------------------------- Package Methods |
284 |
// -------------------------------------------------------- Package Methods |
274 |
|
285 |
|
275 |
|
286 |
|
Lines 378-385
Link Here
|
378 |
context = getServer().getGlobalNamingContext(); |
389 |
context = getServer().getGlobalNamingContext(); |
379 |
} |
390 |
} |
380 |
DataSource dataSource = (DataSource)context.lookup(dataSourceName); |
391 |
DataSource dataSource = (DataSource)context.lookup(dataSourceName); |
381 |
return dataSource.getConnection(); |
392 |
Connection connection = dataSource.getConnection(); |
|
|
393 |
connectionSuccess = true; |
394 |
return connection; |
382 |
} catch (Exception e) { |
395 |
} catch (Exception e) { |
|
|
396 |
connectionSuccess = false; |
383 |
// Log the problem for posterity |
397 |
// Log the problem for posterity |
384 |
containerLog.error(sm.getString("dataSourceRealm.exception"), e); |
398 |
containerLog.error(sm.getString("dataSourceRealm.exception"), e); |
385 |
} |
399 |
} |