Return-Path: Delivered-To: apmail-incubator-beehive-dev-archive@www.apache.org Received: (qmail 774 invoked from network); 12 May 2005 19:04:04 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 12 May 2005 19:04:04 -0000 Received: (qmail 49304 invoked by uid 500); 12 May 2005 19:08:02 -0000 Delivered-To: apmail-incubator-beehive-dev-archive@incubator.apache.org Received: (qmail 49238 invoked by uid 500); 12 May 2005 19:08:01 -0000 Mailing-List: contact beehive-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Beehive Developers" Delivered-To: mailing list beehive-dev@incubator.apache.org Received: (qmail 49170 invoked by uid 99); 12 May 2005 19:07:59 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Received: from ussjmh01.bea.com (HELO ussjmh01.bea.com) (63.96.162.5) by apache.org (qpsmtpd/0.28) with ESMTP; Thu, 12 May 2005 12:07:59 -0700 Received: from ussjfe01.amer.bea.com (ussjfe01b.bea.com [172.16.120.57]) by ussjmh01.bea.com (Switch-3.0.5/Switch-3.0.0) with ESMTP id j4CJ3N4w011149 for ; Thu, 12 May 2005 12:03:23 -0700 Received: from USBOEX01.amer.bea.com ([10.36.32.15]) by ussjfe01.amer.bea.com with Microsoft SMTPSVC(5.0.2195.6713); Thu, 12 May 2005 12:03:23 -0700 X-MimeOLE: Produced By Microsoft Exchange V6.0.6603.0 content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: RE: Problem using transactions with JDBC control Date: Thu, 12 May 2005 13:03:20 -0600 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Problem using transactions with JDBC control Thread-Index: AcVXGnJE4IAkOGEvS2OL2X5JtKjgoQAClr+Q From: "Chad Schoettger" To: "Beehive Developers" X-OriginalArrivalTime: 12 May 2005 19:03:23.0007 (UTC) FILETIME=[44D3E0F0:01C55725] X-PMX-Version: 4.7.0.111621, Antispam-Engine: 2.0.2.0, Antispam-Data: 2005.5.12.17 X-Virus-Checked: Checked X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Hi Scott, The drts for the jdbcontrol include a few unit tests for transactions -- they are not currently failing. Other than the move from controlhaus to beehive nothing has changed in the jdbccontrol code. In the code sample below why is the connection.commit() call commented out? Does it work for you if it is uncommented? =20 - Chad -----Original Message----- From: Scott Semyan=20 Sent: Thursday, May 12, 2005 11:46 AM To: Beehive Developers Subject: Problem using transactions with JDBC control I have a new error in the PetStore web sample. I have a section of code that uses a transaction to add something to the database. I initially enabled this with the following code: =20 public int addOrder(Order order, Cart cart) { try { java.sql.Connection connection =3D _dbControl.getConnection(); connection.setAutoCommit( false ); =20 // Add order to DB // Add the cart items and update the quantities in the DB //connection.commit(); } catch (SQLException e) { _logger.error( "Unexpected DAO exception", e ); throw new DataStoreException("unexpected database exception"); } return orderId; } =20 This used to work fine. Now when I do it, the order is added correctly, but the subsequent call to the database (to read the contents of the order just entered) generates the following: =20 Exception: org.apache.beehive.controls.api.ControlException: SQL Exception while attempting to close database connection.[Invalid transaction state.] caused by : SQL Exception: Invalid transaction state.=20 =20 =20 Did anything change recently? Is this the proper way to do transactions with the JDBC control? =20 Scott Semyan