From 19fa5097805ba0ba1d4c0de5f3363b6262c30fc9 Mon Sep 17 00:00:00 2001 From: Heng Sin Low Date: Wed, 26 Sep 2007 09:52:07 +0000 Subject: [PATCH] [ 1801842 ] DB connection fix & improvements for concurrent threads. - Integrating contribution from the Posterita Team. --- base/src/org/compiere/util/DB.java | 28 +--------------------------- 1 file changed, 1 insertion(+), 27 deletions(-) diff --git a/base/src/org/compiere/util/DB.java b/base/src/org/compiere/util/DB.java index 2a34da6694..0d3787091f 100644 --- a/base/src/org/compiere/util/DB.java +++ b/base/src/org/compiere/util/DB.java @@ -600,33 +600,7 @@ public final class DB { if (SQL == null || SQL.length() == 0) throw new IllegalArgumentException("Required parameter missing - " + SQL); - // - String sql = getDatabase().convertStatement(SQL); - try - { - Connection conn = null; - Trx trx = trxName == null ? null : Trx.get(trxName, true); - if (trx != null) - conn = trx.getConnection(); - else - { - if (resultSetConcurrency == ResultSet.CONCUR_UPDATABLE) - conn = DB.getConnectionRW (); - else - conn = DB.getConnectionRO(); - } - if (conn == null) - throw new DBException("No Connection"); - - return conn.prepareCall - (sql, ResultSet.TYPE_FORWARD_ONLY, resultSetConcurrency); - } - catch (SQLException e) - { - log.log(Level.SEVERE, sql, e); - // throw new DBException(e); - } - return null; + return new CCallableStatement(ResultSet.TYPE_FORWARD_ONLY, resultSetConcurrency, SQL, trxName); } // prepareCall