Revision 650 trunk/org.gvsig.postgresql/org.gvsig.postgresql.provider/src/main/java/org/gvsig/postgresql/dal/PostgreSQLHelper.java
PostgreSQLHelper.java | ||
---|---|---|
3 | 3 |
|
4 | 4 |
import java.sql.Connection; |
5 | 5 |
import java.sql.SQLException; |
6 |
import org.apache.commons.dbcp.BasicDataSource; |
|
6 |
import org.apache.commons.dbcp2.BasicDataSource;
|
|
7 | 7 |
import org.apache.commons.lang3.BooleanUtils; |
8 | 8 |
import org.apache.commons.lang3.StringUtils; |
9 | 9 |
import org.gvsig.expressionevaluator.GeometryExpressionBuilderHelper.GeometrySupportType; |
... | ... | |
75 | 75 |
LOGGER.debug("Error getting connection from pool.",ex); |
76 | 76 |
throw ex; |
77 | 77 |
} |
78 |
try { |
|
79 |
conn.setNetworkTimeout(null, this.connectionParameters.getNetworkTimeout()); |
|
80 |
} catch(Throwable ex) { |
|
81 |
LOGGER.warn("Error setting the network timeout.",ex); |
|
82 |
} |
|
78 | 83 |
if( LOGGER.isDebugEnabled() ) { |
79 | 84 |
LOGGER.debug("Created connection: {}\n NumActive: {}\n NumIdle: {}", |
80 | 85 |
new Object[] { |
... | ... | |
127 | 132 |
builder.append(" PoolPreparedStatements: ").append(this.dataSource.isPoolPreparedStatements()).append("\n"); |
128 | 133 |
builder.append(" MaxOpenPreparedStatements: ").append(this.dataSource.getMaxOpenPreparedStatements()).append(" (The maximum number of open statements that can be allocated from the statement pool at the same time, or non-positive for no limit)\n"); |
129 | 134 |
} |
130 |
builder.append(" MaxActive: ").append(this.dataSource.getMaxActive()).append(" (The maximum number of active connections that can be allocated from this pool at the same time)\n");
|
|
135 |
builder.append(" MaxTotal: ").append(this.dataSource.getMaxTotal()).append(" (The maximum number of active connections that can be allocated from this pool at the same time)\n");
|
|
131 | 136 |
builder.append(" MaxIdle: ").append(this.dataSource.getMaxIdle()).append(" (The maximum number of connections that can remain idle in the pool)\n"); |
132 | 137 |
builder.append(" NumActive:").append(this.dataSource.getNumActive()).append(" (the current number of active connections)\n"); |
133 | 138 |
builder.append(" NumIdle:").append(this.dataSource.getNumIdle()).append(" (the current number of idle connections)\n"); |
... | ... | |
155 | 160 |
} |
156 | 161 |
ds.setUrl(params.getUrl()); |
157 | 162 |
|
158 |
ds.setMaxWait(60L * 1000); |
|
163 |
ds.setMaxWaitMillis(60L * 1000);
|
|
159 | 164 |
return ds; |
160 | 165 |
} |
161 | 166 |
|
Also available in: Unified diff