//make space for 10 extra in case we flow over a bit\r
busy = new ArrayBlockingQueue<PooledConnection>(properties.getMaxActive(),false);\r
//make space for 10 extra in case we flow over a bit\r
- idle = new ArrayBlockingQueue<PooledConnection>(properties.getMaxActive(),false);\r
+ idle = new ArrayBlockingQueue<PooledConnection>(properties.getMaxActive(),properties.isFairQueue());\r
\r
//if the evictor thread is supposed to run, start it now\r
if (properties.isPoolSweeperEnabled()) {\r
protected final static String PROP_INTERCEPTORS = "jdbcInterceptors";\r
protected final static String PROP_VALIDATIONINTERVAL = "validationInterval";\r
protected final static String PROP_JMX_ENABLED = "jmxEnabled";\r
+ protected final static String PROP_FAIR_QUEUE = "fairQueue";\r
\r
public static final int UNKNOWN_TRANSACTIONISOLATION = -1;\r
\r
PROP_CONNECTIONPROPERTIES,\r
PROP_INITSQL,\r
PROP_INTERCEPTORS,\r
- PROP_JMX_ENABLED\r
+ PROP_JMX_ENABLED,\r
+ PROP_FAIR_QUEUE\r
};\r
\r
// -------------------------------------------------- ObjectFactory Methods\r
if (value != null) {\r
dataSource.getPoolProperties().setJmxEnabled(Boolean.parseBoolean(value));\r
}\r
+ \r
+ value = properties.getProperty(PROP_FAIR_QUEUE);\r
+ if (value != null) {\r
+ dataSource.getPoolProperties().setFairQueue(Boolean.parseBoolean(value));\r
+ }\r
+ \r
\r
// Return the configured DataSource instance\r
DataSource ds = getDataSource(dataSource);\r
this.getPoolProperties().setJmxEnabled(enabled);\r
}\r
\r
+ public void setFairQueue(boolean fairQueue) {\r
+ this.getPoolProperties().setFairQueue(fairQueue);\r
+ }\r
+ \r
public void setConnectionProperties(String properties) {\r
try {\r
java.util.Properties prop = DataSourceFactory.getProperties(properties);\r
protected String initSQL;\r
protected boolean testOnConnect =false;\r
private String jdbcInterceptors=null;\r
+ private boolean fairQueue = false;\r
+\r
+ public boolean isFairQueue() {\r
+ return fairQueue;\r
+ }\r
+\r
+ public void setFairQueue(boolean fairQueue) {\r
+ this.fairQueue = fairQueue;\r
+ }\r
\r
public boolean isAccessToUnderlyingConnectionAllowed() {\r
return accessToUnderlyingConnectionAllowed;\r