Return-Path: Delivered-To: apmail-geronimo-user-archive@www.apache.org Received: (qmail 65358 invoked from network); 30 May 2006 15:47:48 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 30 May 2006 15:47:48 -0000 Received: (qmail 33107 invoked by uid 500); 30 May 2006 15:47:48 -0000 Delivered-To: apmail-geronimo-user-archive@geronimo.apache.org Received: (qmail 32494 invoked by uid 500); 30 May 2006 15:47:46 -0000 Mailing-List: contact user-help@geronimo.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: user@geronimo.apache.org List-Id: Delivered-To: mailing list user@geronimo.apache.org Received: (qmail 32482 invoked by uid 99); 30 May 2006 15:47:46 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 30 May 2006 08:47:46 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [217.160.108.180] (HELO yukon.coderesearch.com) (217.160.108.180) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 30 May 2006 08:47:45 -0700 Received: (qmail 29298 invoked from network); 30 May 2006 17:47:09 +0100 Received: from p54b84a75.dip0.t-ipconnect.de (HELO ?192.168.8.11?) (84.184.74.117) by coderesearch.com with (DHE-RSA-AES256-SHA encrypted) SMTP; 30 May 2006 17:47:09 +0100 Message-ID: <447C6902.1060009@coderesearch.com> Date: Tue, 30 May 2006 17:47:14 +0200 From: =?ISO-8859-1?Q?Mario_R=FCbsam?= User-Agent: Thunderbird 1.5.0.2 (Windows/20060308) MIME-Version: 1.0 To: user@geronimo.apache.org Subject: Re: Problem with Geronimo 1.0, PreparedStatements, pools and MaxDB References: <447C3184.1090406@coderesearch.com> <74e15baa0605300714g68bc928vbddf7510ac030163@mail.gmail.com> <447C65A1.8040604@coderesearch.com> In-Reply-To: <447C65A1.8040604@coderesearch.com> Content-Type: multipart/mixed; boundary="------------000500020609020304040306" X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N This is a multi-part message in MIME format. --------------000500020609020304040306 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Aaron, here is a stack trace attached, it hangs sometimes when calling the prepareStatement and sometimes when executing the statement and it's not always the same statement. Thanks, Mario Mario R�bsam wrote: > Aaron, > > connections are correctly closed. If they are returned to the pool, > don't know? > > The code that opens/closes connections is a bit widespread and wrapped > into a db abstraction layer. Here are some code fragments collected > together without the try catches. > > > open connection: > > InitialContext tCtx = new InitialContext(); > > mJDBCDataSource = (DataSource)tCtx.lookup( > pDataSource.getString(PDbDataSource.URL)); > > String tUser = pDataSource.getString(PDbDataSource.USER, null); > String tPass = pDataSource.getString(PDbDataSource.PASS, null); > > if (tUser != null) { > mConnection = mJDBCDataSource.getConnection(tUser, tPass); > } else { > mConnection = mJDBCDataSource.getConnection(); > } > > mConnection.setAutoCommit(false); > > > > call statements: > > String tStmtSQL = "SELECT ...."; > PreparedStatement tStmt = mConnection.prepareStatement(tStmtSQL); > > tStmt.setString(1, tName); > ResultSet tRS = tStmt.executeQuery(); > > while (tRS.next()) { > ... > } > > tRS.close(); > tStmt.close(); > > > > close the connection: > > mConnection.close(); > > > > The DataSource lookup happens only once. After that I only > call getConnection() on the DS and close() on the connection. > > Thanks, > Mario > > > > Aaron Mulder wrote: >> It sounds like connections are not being returned to the pool, though >> it's hard to know without a stack trace. Also, can you post the code >> you're using to access the connection pool, execute the prepared >> statements, and close the connection? And what kind of component is >> running these prepared statements? >> >> Thanks, >> Aaron >> >> On 5/30/06, Mario R�bsam wrote: >>> Hi, >>> >>> I have some serious problems when executing prepared statements >>> on MaxDB with pooled connections managed by Tranql in Geronimo 1.0. >>> >>> The problem is, that after calling a lot of these prepared statements >>> the connection will hang until I get a timout. It's always >>> a different statement that worked just fine some milliseconds before. >>> There is no CPU load on the Geronimo machine and also no load >>> on the DB machine. Just a hang up until timeout. >>> I can run the same app on MySQL 4.x or PostgrSQL 8.x without any >>> Problems. Also no problems with a client app and MaxDB that do >>> a batch import and use exactly the same statements but without db >>> pooling. >>> >>> So I think it must be a db pool problem with the MaxDB or a >>> strange behaviour with that driver and connection pools. >>> >>> Any suggestions where I can start analysing the problem? >>> >>> here my MaxDB plan: >>> >>> >>> >> xmlns="http://geronimo.apache.org/xml/ns/j2ee/connector-1.0"> >>> >> xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.0"> >>> mysql/sapdbc/7.6/jar >>> >>> >>> >>> >>> >>> javax.sql.DataSource >>> >>> >>> jdbc/default >>> >> name="UserName">sse >>> >> name="Password">sse >>> >> name="CommitBeforeAutocommit">false >>> >> name="Driver">com.sap.dbtech.jdbc.DriverSapDB >>> >> name="ExceptionSorterClass">org.tranql.connector.AllExceptionsAreFatalSorter >>> >>> >> name="ConnectionURL">jdbc:sapdb://192.168.8.3/service >>> >>> >>> >>> >>> 100 >>> 50 >>> >>> 60000 >>> >>> 60 >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> Thanks, >>> Mario >>> >> > -- Dipl. Inf. Mario R�bsam Gesch�ftsf�hrer CODERESEARCH GmbH & Co. KG mail: mr@coderesearch.com web : www.coderesearch.com tel : 03677/466420 fax : 03677/466419 --------------000500020609020304040306 Content-Type: text/plain; name="stack.txt" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="stack.txt" DEBUG DATE=2006-05-30 TIME=13:42:22:046 CATEGORY=cpa.db SOURCE=mr@aeon:CDbContext.getPreparedStatement() SID=cpa.1-1-1.cpa MESSAGE=prepare statement "SELECT TbRegistryValues.TcValueText,TbRegistryValues.TcValueLineNo FROM TbRegistry,TbRegistryValues WHERE ((TbRegistry.TcEntityId=TbRegistryValues.TcEntityId) AND (TbRegistry.TcDomain=?)) ORDER BY TbRegistryValues.TcValueLineNo" DEBUG DATE=2006-05-30 TIME=17:38:50:421 CATEGORY=cpa.db SOURCE=mr@aeon:CDbContext.getPreparedStatement() SID=cpa.1-1-1.cpa MESSAGE=prepared statement "org.tranql.connector.jdbc.PreparedStatementHandle@1728a26" 13:42:22,046 WARN [GeronimoConnectionEventListener] connectionErrorOccurred called with null com.sap.dbtech.jdbc.exceptions.ConnectionException: [-708] Timeout at com.sap.dbtech.jdbc.ConnectionSapDB.execute(ConnectionSapDB.java:554) at com.sap.dbtech.jdbc.CallableStatementSapDB.sendCommand(CallableStatementSapDB.java:1764) at com.sap.dbtech.jdbc.StatementSapDB.sendSQL(StatementSapDB.java:808) at com.sap.dbtech.jdbc.CallableStatementSapDB.doParse(CallableStatementSapDB.java:233) at com.sap.dbtech.jdbc.CallableStatementSapDB.constructor(CallableStatementSapDB.java:186) at com.sap.dbtech.jdbc.CallableStatementSapDB.(CallableStatementSapDB.java:88) at com.sap.dbtech.jdbc.ConnectionSapDB.prepareStatement(ConnectionSapDB.java:803) at org.tranql.connector.jdbc.ConnectionHandle.prepareStatement(ConnectionHandle.java:231) at com.coderesearch.cpa.db.jdbc.CDbContext.getPreparedStatement(CDbContext.java:1131) at com.coderesearch.cpa.reg.db.jdbc.CDbBrokerRegistry.lookup(CDbBrokerRegistry.java:129) at com.coderesearch.cpa.reg.db.jdbc.CDbBrokerRegistry.query(CDbBrokerRegistry.java:430) at com.coderesearch.cpa.naming.CPANamingContextDb.lookup(CPANamingContextDb.java:116) at com.coderesearch.cpa.reg.CPARegistryContext.lookup(CPARegistryContext.java:256) at com.coderesearch.cpa.reg.Registry.lookupInt(Registry.java:199) at com.coderesearch.abp.index.srv.CRPIndex.countLogin(CRPIndex.java:140) at com.coderesearch.abp.index.srv.CRPIndex.process(CRPIndex.java:266) at com.coderesearch.abp.found.srv.MainServlet.process(MainServlet.java:482) at com.coderesearch.abp.found.srv.MainServlet.doPost(MainServlet.java:610) at javax.servlet.http.HttpServlet.service(HttpServlet.java:615) at javax.servlet.http.HttpServlet.service(HttpServlet.java:688) at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:428) at org.apache.geronimo.jetty.JettyServletHolder.handle(JettyServletHolder.java:99) at org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter(WebApplicationHandler.java:830) at org.mortbay.jetty.servlet.JSR154Filter.doFilter(JSR154Filter.java:170) at org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter(WebApplicationHandler.java:821) at org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationHandler.java:471) at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:568) at org.mortbay.http.HttpContext.handle(HttpContext.java:1530) at org.mortbay.jetty.servlet.WebApplicationContext.handle(WebApplicationContext.java:633) at org.mortbay.http.HttpContext.handle(HttpContext.java:1482) at org.mortbay.http.HttpServer.service(HttpServer.java:909) at org.mortbay.http.HttpConnection.service(HttpConnection.java:816) at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:982) at org.mortbay.http.HttpConnection.handle(HttpConnection.java:833) at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:244) at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:357) at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:534) --------------000500020609020304040306--