From dev-return-59741-apmail-lucene-dev-archive=lucene.apache.org@lucene.apache.org Thu Nov 18 17:12:10 2010 Return-Path: Delivered-To: apmail-lucene-dev-archive@www.apache.org Received: (qmail 89787 invoked from network); 18 Nov 2010 17:12:09 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 18 Nov 2010 17:12:09 -0000 Received: (qmail 27098 invoked by uid 500); 18 Nov 2010 17:12:35 -0000 Delivered-To: apmail-lucene-dev-archive@lucene.apache.org Received: (qmail 26946 invoked by uid 500); 18 Nov 2010 17:12:35 -0000 Mailing-List: contact dev-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@lucene.apache.org Delivered-To: mailing list dev@lucene.apache.org Received: (qmail 26924 invoked by uid 99); 18 Nov 2010 17:12:35 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 18 Nov 2010 17:12:35 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.22] (HELO thor.apache.org) (140.211.11.22) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 18 Nov 2010 17:12:34 +0000 Received: from thor (localhost [127.0.0.1]) by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id oAIHCDMB024681 for ; Thu, 18 Nov 2010 17:12:14 GMT Message-ID: <20927616.177811290100333878.JavaMail.jira@thor> Date: Thu, 18 Nov 2010 12:12:13 -0500 (EST) From: =?utf-8?Q?Kjetil_=C3=98degaard_=28JIRA=29?= To: dev@lucene.apache.org Subject: [jira] Commented: (SOLR-2045) DIH doesn't release jdbc connections in conjunction with DB2 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/SOLR-2045?page=3Dcom.atlassian.= jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D12933= 479#action_12933479 ]=20 Kjetil =C3=98degaard commented on SOLR-2045: --------------------------------------- We see the same issue on Oracle (11g). > DIH doesn't release jdbc connections in conjunction with DB2=20 > ------------------------------------------------------------- > > Key: SOLR-2045 > URL: https://issues.apache.org/jira/browse/SOLR-2045 > Project: Solr > Issue Type: Bug > Components: contrib - DataImportHandler > Affects Versions: 1.4.1 > Environment: DB2 SQLLIB 9.5, 9.7 jdbc Driver > Reporter: Fenlor Sebastia > > Using the JDBCDatasource in conjunction with the DB2 JDBC Drivers results= in the following error when the DIH tries to close the the connection due = to active transactions. As a consequence each delta im port or full import = opens a new connection without closing it. So the maximum amount of connect= ions will be reached soon. Setting the connection to readOnly or changing t= he transaction isolation level doesn't help neither. > The JDBC Driver I used: "com.ibm.db2.jcc.DB2Driver" relieing in db2jcc4.j= ar shipped with DB2 Express 9.7 for example > Here is the stack trace... > 14.08.2010 01:49:51 org.apache.solr.handler.dataimport.JdbcDataSource clo= seConnection > FATAL: Ignoring Error when closing connection > com.ibm.db2.jcc.am.SqlException: [jcc][10251][10308][4.8.87] java.sql.Con= nection.close() requested while a transaction is in progress on the connect= ion.The transaction remains active, and the connection cannot be closed. ER= RORCODE=3D-4471, SQLSTATE=3Dnull > =09at com.ibm.db2.jcc.am.gd.a(gd.java:660) > =09at com.ibm.db2.jcc.am.gd.a(gd.java:60) > =09at com.ibm.db2.jcc.am.gd.a(gd.java:120) > =09at com.ibm.db2.jcc.am.lb.u(lb.java:1202) > =09at com.ibm.db2.jcc.am.lb.x(lb.java:1225) > =09at com.ibm.db2.jcc.am.lb.v(lb.java:1211) > =09at com.ibm.db2.jcc.am.lb.close(lb.java:1195) > =09at com.ibm.db2.jcc.uw.UWConnection.close(UWConnection.java:838) > =09at org.apache.solr.handler.dataimport.JdbcDataSource.closeConnection(J= dbcDataSource.java:399) > =09at org.apache.solr.handler.dataimport.JdbcDataSource.close(JdbcDataSou= rce.java:390) > =09at org.apache.solr.handler.dataimport.DataConfig$Entity.clearCache(Dat= aConfig.java:173) > =09at org.apache.solr.handler.dataimport.DataConfig.clearCaches(DataConfi= g.java:331) > =09at org.apache.solr.handler.dataimport.DataImporter.doFullImport(DataIm= porter.java:339) > =09at org.apache.solr.handler.dataimport.DataImporter.runCmd(DataImporter= .java:389) > =09at org.apache.solr.handler.dataimport.DataImporter$1.run(DataImporter.= java:370) > Well the issue can be solved by invoking a commit or rollback directly be= fore the connection.close() statement. Here is the code snipped of changes = I made in JdbcDatasource.java > private void closeConnection() { > try { > if (conn !=3D null) { > =09if (conn.isReadOnly()) > =09=09{ > =09=09=09LOG.info("connection is readonly, therefore rollback"); > =09=09=09conn.rollback(); > =09=09} else > =09=09{ > =09=09=09LOG.info("connection is not readonly, therefore commit"); > =09=09=09conn.commit(); > =09=09} > =09 =20 > conn.close(); > } > } catch (Exception e) { > LOG.error("Ignoring Error when closing connection", e); > } > } --=20 This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org For additional commands, e-mail: dev-help@lucene.apache.org