Return-Path: Mailing-List: contact ibatis-user-java-help@incubator.apache.org; run by ezmlm Delivered-To: mailing list ibatis-user-java@incubator.apache.org Received: (qmail 33331 invoked by uid 99); 29 Jan 2005 07:28:35 -0000 X-ASF-Spam-Status: No, hits=2.5 required=10.0 tests=DNS_FROM_RFC_ABUSE,FORGED_YAHOO_RCVD X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Received: from web30209.mail.mud.yahoo.com (HELO web30209.mail.mud.yahoo.com) (68.142.200.92) by apache.org (qpsmtpd/0.28) with SMTP; Fri, 28 Jan 2005 23:28:34 -0800 Received: (qmail 16326 invoked by uid 60001); 29 Jan 2005 07:28:30 -0000 Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; b=yYAUfiOAUgXG76WJbK8kC33xqDFBQ1zygvKuQKu18uiPmr7J4n+HVSr7GMD0M3mC2zigEAQEOI2OVWHzFoIYsL3Pob7z8oB/dvP0JHZbqXAcD/IY+4FPKxhDjyUmulIFVUrr7NGo1U7ZeQHmJld0IWSV92P/rQzjpgBUDc3ow7c= ; Message-ID: <20050129072830.16324.qmail@web30209.mail.mud.yahoo.com> Received: from [199.217.207.70] by web30209.mail.mud.yahoo.com via HTTP; Fri, 28 Jan 2005 23:28:30 PST Date: Fri, 28 Jan 2005 23:28:30 -0800 (PST) From: Mark Nabours Subject: Re: WebSphere 5.1.X -- LocalTransaction rolled-back due to setRollbackOnly To: ibatis-user-java@incubator.apache.org, cbegin@ibatis.com In-Reply-To: <16178eb105012820471a271709@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Checked: Checked Clinton, Thanks for the quick reply. I'm happy to report that I found a couple of places where we weren't closing a connection properly that fell outside our normal connection management. I updated the code to close the connections properly and the Exceptions are gone (Hallelujah). One quick question, can I configure a transactionManger although I don't configure a datasource in the XML since I externally acquire the connection? The dtd requires the datasource element I believe. Keep up the great work. Thanks, Mark --- Clinton Begin wrote: > Please set > > > More info is available in the following poorly > titled wiki (my fault): > > http://wiki.apache.org/ibatis/Database_20Specific_20Information > > Clinton > > > On Fri, 28 Jan 2005 19:09:29 -0800 (PST), Mark > Nabours > wrote: > > > > > > Hello. > > > > > > > > We are currently developing our first application > with iBATIS, and we are > > extremely impressed by its design and > capabilities. Everything was going > > great until we deployed our application to WAS 5.1 > utilizing a JNDI > > datasource. > > > > > > > > We end up receiving the following exception: > > > > [1/28/05 20:31:45:954 CST] 796d3dfd WebGroup E > SRVE0026E: [Servlet > > Error]-[LocalTransaction rolled-back due to > setRollbackOnly]: > > com.ibm.ws.LocalTransaction.RolledbackException > > > > > > > > I've read the following post concerning issues > with WebSphere: > > > > > http://wiki.apache.org/ibatis/Database_20Specific_20Information > > > > > > > > > But I'm afraid that we cannot implement the > suggestions since we externally > > acquire a connection and pass it to the > SqlMapClient. Therefore, I'm not > > sure how or if we can set a transactionManager > element within our > > configuration file since it requires a dataSource > element as a child. > > Currently, we do not have a transactionManager > element at all. > > > > > > > > Here is the code we use to pass the connection > (sorry about the formatting > > -- I'm using a web-based e-mail editor) : > > > > > > > > /** > > > > * Returns the cached {@link > SqlMapClient} instance for the > > DataSource alias. > > > > */ > > > > protected SqlMapClient getSqlMapClient(String > dataSourceAlias) > > > > throws SQLException { > > > > > > try { > > > > > > SqlMapClient sqlMapClient = > > > > IBatisSqlMapService.getInstance().getSqlMapClient( > > > > > dataSourceAlias); > > > > if (sqlMapClient.getCurrentConnection() == null) { > > > > > //try to acquire a Connection from the abstract > broker > > > > try { > > > > > > Connection connection = > > > > getDatabaseConnection(dataSourceAlias); > > > > if (connection != null) { > > > > sqlMapClient.setUserConnection(connection); > > > > logger.debug( > > > > "Connection set via Common Services for \"" > > > > + dataSourceAlias > > > > + "\"."); > > > > } else { > > > > logger.debug( > > > > "Connection not configured via Common Services for > \"" > > > > + dataSourceAlias > > > > + "\". Assuming iBatis will supply connection."); > > > > } > > > > } catch (SQLException e) { > > > > > > logger.debug( > > > > "Connection not configured via Common Services for > \"" > > > > + dataSourceAlias > > > > + "\". Assuming iBatis will supply connection."); > > > > } > > > > } > > > > return sqlMapClient; > > > > } catch (IOException e) { > > > > throw new Error(e); > > > > } > > > > } > > > > > > > > Also we "clean up" the application supplied user > connection with the > > following code: > > > > > > > > /** > > > > * Clear out the {@link Connection} > instanced stored by this > > thread's > > > > * {@link SqlMapClient} instance keyed > by > > dataSourceName. > > > > */ > > > > public void closeConnection(String dataSourceName) > throws SQLException { > > > > try { > > > > //clear out user connection on sql map > > > > > > SqlMapClient sqlMapClient = > > > > > IBatisSqlMapService.getInstance().getSqlMapClient(dataSourceName); > > > > > if (sqlMapClient != null) { > > > > > > //explicitly commit transaction prior to close > > > > Connection connection = > sqlMapClient.getCurrentConnection(); > > > > if (connection != null) { > > > > > === message truncated === __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250