Return-Path: Delivered-To: apmail-ibatis-user-java-archive@www.apache.org Received: (qmail 72221 invoked from network); 30 Nov 2006 17:01:00 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 30 Nov 2006 17:01:00 -0000 Received: (qmail 1774 invoked by uid 500); 30 Nov 2006 17:01:06 -0000 Delivered-To: apmail-ibatis-user-java-archive@ibatis.apache.org Received: (qmail 1755 invoked by uid 500); 30 Nov 2006 17:01:06 -0000 Mailing-List: contact user-java-help@ibatis.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user-java@ibatis.apache.org Delivered-To: mailing list user-java@ibatis.apache.org Received: (qmail 1705 invoked by uid 99); 30 Nov 2006 17:01:06 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 30 Nov 2006 09:01:06 -0800 X-ASF-Spam-Status: No, hits=1.3 required=10.0 tests=DNS_FROM_RFC_ABUSE,INFO_TLD,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of e.macarron@iberdrola.es designates 217.22.96.70 as permitted sender) Received: from [217.22.96.70] (HELO sol2g1.iberdrola.es) (217.22.96.70) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 30 Nov 2006 09:00:53 -0800 Received: by lbbilarr011.corp.iberdrola.local with Internet Mail Service (5.5.2657.72) id ; Thu, 30 Nov 2006 18:00:30 +0100 Message-ID: <8731BA60EC56E0468037461A10706B3E03386421@clbilarr02a.corp.iberdrola.local> From: "Macarron Miegemolle, Eduardo" To: "'user-java@ibatis.apache.org'" Subject: Problem when flushing caches by code on version 2.1.7 Date: Thu, 30 Nov 2006 18:00:23 +0100 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2657.72) Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org Hi there, Or app has an isolated module that serves data that usually don=B4t change. When we alter some rows at BD we call a method that is supposed to flush all caches. This is our flush code: public void invalidaCacheNegocio() { log.info("Invalidando cach=E9 de negocio..."); =09 DaoManager daoManager =3D DaoConfig.getDaoManager(); LiteralCacheDao dao =3D (LiteralCacheDao) daoManager.getDao(LiteralNegCacheDao.class); // un DaoTransaction es un wrapper de un SQLMapClient // creemos que solo hay un sqlmapclient para todo SqlMapDaoTransaction sqlMapDaoTransaction =3D (SqlMapDaoTransaction) daoManager.getTransaction((Dao)dao); =09 // flush de todas las cach=E9s sqlMapDaoTransaction.getSqlMap().flushDataCache(); =09 log.info("cach=E9 de negocio invalidada"); } =09 It runs into an Session bean with containter managed transaction. iBatis is configured to use EXTERNAL transaction manager. Usually this method works fine but some days ago we have had some errors. A dump analysis has revealed some interesting info: java.lang.Object@31C2EB18/31C2EB20 Waiters....... 33 Thread information: Thread type..................... Servlet handler name............................ SoapConnectorThreadPool : 1257 thread id....................... 0x5D3CCBA0=20 priority........................ 5 state........................... CW Waiting on monitor................ java.lang.Object@31C2EB18/31C2EB20 Waiting for web work............. no Executing web or local EJB work.. no Waiting for remote orb work...... no Stack:=20 java.lang.Object.wait in null native=3Dtrue java.lang.Object.wait in Object.java native=3Dfalse com.ibatis.common.util.Throttle.increment in Throttle.java native=3Dfalse com.ibatis.common.util.ThrottledPool.pop in ThrottledPool.java native=3Dfalse com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.popSession= in SqlMapExecutorDelegate.java native=3Dfalse com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl. in SqlMapSessionImpl.java native=3Dfalse =20 com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.getLocalSqlMapSession in SqlMapClientImpl.java native=3Dfalse com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.startTransaction= in SqlMapClientImpl.java native=3Dfalse =20 com.ibatis.dao.engine.transaction.sqlmap.SqlMapDaoTransaction. in SqlMapDaoTransaction.java native=3Dfalse =20 com.ibatis.dao.engine.transaction.sqlmap.SqlMapDaoTransactionManager.startT= r ansaction in SqlMapDaoTransactionManager.java native=3Dfalse com.ibatis.dao.engine.impl.DaoContext.startTransaction in DaoContext.java native=3Dfalse com.ibatis.dao.engine.impl.DaoContext.getTransaction in DaoContext.java native=3Dfalse com.ibatis.dao.engine.impl.StandardDaoManager.getTransaction in StandardDaoManager.java native=3Dfalse =20 com.iberdrola.sic.seguridad.dominio.accion.FrameworkApp.invalidaCacheTecnic= a in FrameworkApp.java native=3Dfalse =20 com.iberdrola.sic.seguridad.dominio.accion.ServiciosNatImpl.invalidaCacheTe= c nica in ServiciosNatImpl.java native=3Dfalse Notice that there are 33 threads bloqued on ThrottledPool! This problem is reported as a bug on 2.1.7 version: http://www.mail-archive.com/dev@ibatis.apache.org/msg00939.html But it's too late for us to go a version up, and don=B4t want to use not-GA versions so I would like to solve this on 2.1.7 maybe changing our code.=20 I think there are two possibilities: - First: Include a dummy SQL sentence with a flushOnExecute. This is a problem because we have lot of sqlmap xml files. - Second: Add this sentence to the cache-flush code: sqlMapDaoTransaction.commit(); Here I need your opinion because I have a very poor knowledge about iBatis internals. Does this sence make sense in our case? Could it resolver the ThrottledPool deadlock? BTW, will this problem be fixed on 2.1.7 version? Thanks!! =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Este mensaje se dirige exclusivamente a su destinatario. La informaci=F3n= incluida en el presente correo es confidencial sometida a secreto profesional,= especialmente en lo que respecta a los datos personales, cuya divulgaci=F3n est=E1 prohibida, en= virtud de la legislaci=F3n vigente. Si usted no lo es y lo ha recibido por error o tiene= conocimiento del mismo por cualquier motivo, le rogamos que nos lo comunique por este= medio y proceda a destruirlo o borrarlo, y que en todo caso se abstenga de utilizar,= reproducir, alterar, archivar o comunicar a terceros el presente mensaje y ficheros anexos, todo= ello bajo pena de incurrir en responsabilidades legales. Cualquier opini=F3n= contenida en este correo es exclusiva de su autor y no representa necesariamente la opini=F3n de= Iberdrola. El emisor no garantiza la integridad, rapidez o seguridad del presente correo,= ni se responsabiliza de posibles perjuicios derivados de la captura,= incorporaciones de virus o cualesquiera otras manipulaciones efectuadas por terceros. This message is intended for the exclusive attention of the addressee(s)= indicated. Any information contained herein is strictly confidential and privileged,= especially as regards personal data, which must not be disclosed, in accordance with= legislation currently in force. If you are not the intended recipient and have received= it by mistake or learn about it in any other way, please notify us by return e-mail and= delete this message from your computer system. Any unauthorised use, reproduction,= alteration, filing or sending of this message and/or any attached files to third parties may= lead to legal proceedings being taken. Any opinion expressed herein is solely that of the= author(s) and does not necessarily represent the opinion of Iberdrola. The sender does= not guarantee the integrity, speed or safety of this message, not accept responsibility= for any possible damage arising from the interception, incorporation of virus or= any other manipulation carried out by third parties. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D