mirror of https://github.com/apache/activemq.git
Apply patch for https://issues.apache.org/activemq/browse/AMQ-1244
git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@669733 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
99372e1189
commit
f7303237ad
|
@ -80,6 +80,7 @@ public class JDBCPersistenceAdapter extends DataSourceSupport implements Persist
|
|||
private long lockKeepAlivePeriod = 1000*30;
|
||||
private DatabaseLocker databaseLocker;
|
||||
private boolean createTablesOnStartup = true;
|
||||
private DataSource lockDataSource;
|
||||
|
||||
public JDBCPersistenceAdapter() {
|
||||
}
|
||||
|
@ -267,6 +268,24 @@ public class JDBCPersistenceAdapter extends DataSourceSupport implements Persist
|
|||
}
|
||||
return databaseLocker;
|
||||
}
|
||||
|
||||
public DataSource getLockDataSource() throws IOException {
|
||||
if (lockDataSource == null) {
|
||||
lockDataSource = getDataSource();
|
||||
if (lockDataSource == null) {
|
||||
throw new IllegalArgumentException(
|
||||
"No dataSource property has been configured");
|
||||
}
|
||||
} else {
|
||||
LOG.info("Using a separate dataSource for locking: "
|
||||
+ lockDataSource);
|
||||
}
|
||||
return lockDataSource;
|
||||
}
|
||||
|
||||
public void setLockDataSource(DataSource dataSource) {
|
||||
this.lockDataSource = dataSource;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the database locker strategy to use to lock the database on startup
|
||||
|
@ -481,7 +500,7 @@ public class JDBCPersistenceAdapter extends DataSourceSupport implements Persist
|
|||
}
|
||||
|
||||
protected DatabaseLocker createDatabaseLocker() throws IOException {
|
||||
return new DefaultDatabaseLocker(getDataSource(), getStatements());
|
||||
return new DefaultDatabaseLocker(getLockDataSource(), getStatements());
|
||||
}
|
||||
|
||||
public void setBrokerName(String brokerName) {
|
||||
|
|
Loading…
Reference in New Issue