public class AbandonedConfig extends Object
Constructor and Description |
---|
AbandonedConfig() |
Modifier and Type | Method and Description |
---|---|
boolean |
getLogAbandoned()
Flag to log stack traces for application code which abandoned
a Statement or Connection.
|
PrintWriter |
getLogWriter()
Returns the log writer being used by this configuration to log
information on abandoned objects.
|
boolean |
getRemoveAbandoned()
Flag to remove abandoned connections if they exceed the
removeAbandonedTimeout.
|
int |
getRemoveAbandonedTimeout()
Timeout in seconds before an abandoned connection can be removed.
|
void |
setLogAbandoned(boolean logAbandoned)
Flag to log stack traces for application code which abandoned
a Statement or Connection.
|
void |
setLogWriter(PrintWriter logWriter)
Sets the log writer to be used by this configuration to log
information on abandoned objects.
|
void |
setRemoveAbandoned(boolean removeAbandoned)
Flag to remove abandoned connections if they exceed the
removeAbandonedTimeout.
|
void |
setRemoveAbandonedTimeout(int removeAbandonedTimeout)
Sets the timeout in seconds before an abandoned connection can be
removed.
|
public boolean getRemoveAbandoned()
Flag to remove abandoned connections if they exceed the removeAbandonedTimeout.
The default value is false.
If set to true a connection is considered abandoned and eligible
for removal if it has been idle longer than the
removeAbandonedTimeout
.
public void setRemoveAbandoned(boolean removeAbandoned)
Flag to remove abandoned connections if they exceed the removeAbandonedTimeout.
If set to true a connection is considered abandoned and eligible
for removal if it has been idle longer than the
removeAbandonedTimeout
.
removeAbandoned
- true means abandoned connections will be
removedgetRemoveAbandoned()
public int getRemoveAbandonedTimeout()
Timeout in seconds before an abandoned connection can be removed.
Creating a Statement, PreparedStatement or CallableStatement or using one of these to execute a query (using one of the execute methods) resets the lastUsed property of the parent connection.
Abandoned connection cleanup happens when
removeAbandoned
== truenumIdle
< 2numActive
>
maxActive
- 3The default value is 300 seconds.
public void setRemoveAbandonedTimeout(int removeAbandonedTimeout)
Sets the timeout in seconds before an abandoned connection can be removed.
Setting this property has no effect if
removeAbandoned
is false.
removeAbandonedTimeout
- new abandoned timeout in secondsgetRemoveAbandonedTimeout()
,
getRemoveAbandoned()
public boolean getLogAbandoned()
public void setLogAbandoned(boolean logAbandoned)
logAbandoned
- true turns on abandoned stack trace loggingpublic PrintWriter getLogWriter()
public void setLogWriter(PrintWriter logWriter)
logWriter
- The new log writerCopyright © 2000-2021 Apache Software Foundation. All Rights Reserved.