IDEMPIERE-287 org.postgresql.util.PSQLException: Bad value for type int : 2min
This commit is contained in:
parent
e93dee5efc
commit
740243db9b
|
@ -939,9 +939,29 @@ public class DB_PostgreSQL implements AdempiereDatabase
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
rs = conn.createStatement().executeQuery("select current_setting('statement_timeout')");
|
rs = conn.createStatement().executeQuery("select current_setting('statement_timeout')");
|
||||||
if (rs.next())
|
if (rs.next()) {
|
||||||
|
String setting = rs.getString(1);
|
||||||
|
if (setting != null) {
|
||||||
|
if (setting.endsWith("min")) {
|
||||||
|
setting = setting.substring(0, setting.length() - "min".length());
|
||||||
|
try {
|
||||||
|
currentTimeout = Integer.parseInt(setting);
|
||||||
|
currentTimeout = currentTimeout * 60;
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.log(Level.INFO, e.getLocalizedMessage(), e);
|
||||||
|
}
|
||||||
|
} else if (setting.endsWith("s")) {
|
||||||
|
setting = setting.substring(0, setting.length() - "s".length());
|
||||||
|
try {
|
||||||
|
currentTimeout = Integer.parseInt(setting);
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.log(Level.INFO, e.getLocalizedMessage(), e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
currentTimeout = rs.getInt(1) / 1000;
|
currentTimeout = rs.getInt(1) / 1000;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
DB.close(rs);
|
DB.close(rs);
|
||||||
|
|
Loading…
Reference in New Issue