Return-Path: Delivered-To: apmail-ibatis-user-java-archive@www.apache.org Received: (qmail 69380 invoked from network); 4 Jul 2007 14:26:23 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 4 Jul 2007 14:26:23 -0000 Received: (qmail 46723 invoked by uid 500); 4 Jul 2007 14:26:11 -0000 Delivered-To: apmail-ibatis-user-java-archive@ibatis.apache.org Received: (qmail 46709 invoked by uid 500); 4 Jul 2007 14:26:11 -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 46688 invoked by uid 99); 4 Jul 2007 14:26:11 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 04 Jul 2007 07:26:11 -0700 X-ASF-Spam-Status: No, hits=2.5 required=10.0 tests=HTML_MESSAGE,NO_REAL_NAME,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of bharathi.mani@accenture.com designates 170.252.248.71 as permitted sender) Received: from [170.252.248.71] (HELO amrmr1002.accenture.com) (170.252.248.71) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 04 Jul 2007 07:26:07 -0700 Received: from AMRXV1002.dir.svc.accenture.com (amrxv1002.dir.svc.accenture.com [10.10.160.62]) by amrmr1002.accenture.com (8.13.8/8.13.8) with ESMTP id l64EPcnb029269 for ; Wed, 4 Jul 2007 09:25:45 -0500 (CDT) Received: from APAXR2001.dir.svc.accenture.com ([10.189.16.21]) by AMRXV1002.dir.svc.accenture.com with Microsoft SMTPSVC(6.0.3790.1830); Wed, 4 Jul 2007 09:25:24 -0500 Received: from APAXM2103.dir.svc.accenture.com ([10.189.16.12]) by APAXR2001.dir.svc.accenture.com with Microsoft SMTPSVC(6.0.3790.1830); Wed, 4 Jul 2007 19:55:45 +0530 Content-Transfer-Encoding: 7bit X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.2826 Content-class: urn:content-classes:message MIME-Version: 1.0 Importance: normal Priority: normal Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C7BE47.252DD717" Subject: RE: transaction rollback Date: Wed, 4 Jul 2007 19:54:12 +0530 Message-ID: <95A15C4363D79944971A2D1CB36F5D490234CA3A@APAXM2103.dir.svc.accenture.com> In-reply-to: <5820E7E2A928DB46824297946AC2024A9A6309@pandore.ircm.priv> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: transaction rollback Thread-Index: Ace9/T9VYr7Di8zUTRq6OysGzMAJ5gAQdB7gAAA6V1A= From: To: , X-OriginalArrivalTime: 04 Jul 2007 14:25:45.0796 (UTC) FILETIME=[35CD7040:01C7BE47] X-Virus-Checked: Checked by ClamAV on apache.org This is a multi-part message in MIME format. ------_=_NextPart_001_01C7BE47.252DD717 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable I find that each operation on the object gets committed as and when it is executed. For example, I have defined a method insert in service layer. I have made the service class transactional. When I invoke the insert method on the object in a while loop, for each iteration, the statement is getting committed. =20 @Transactional public class PositionManagerImpl extends BaseManager implements PositionManager { private PositionDao positionDao; =20 /** * Set the Dao for communication with the data layer. *=20 * @param dao */ public void setPositionDao(PositionDao dao) { this.positionDao =3D dao; } =20 /** * @see com.calyon.foursight.soa.service.PositionManager#getPositions(com.calyon .foursight.soa.model.Position) */ public List getPositions(Position position) { =20 return positionDao.getPositions(position); } =20 /** * @see com.calyon.foursight.soa.service.PositionManager#addPositions(HashMap * map) */ public void addPositions(HashMap map) { positionDao.addPositions(map); } } I am using Oracle database. =20 The config file im using is: =20 =20 classpath:/com/calyon/foursight/soa/dao/ibatis/sql-map-config.xml =20 =20 ________________________________ From: Poitras Christian [mailto:Christian.Poitras@ircm.qc.ca]=20 Sent: Wednesday, July 04, 2007 6:59 PM To: user-java@ibatis.apache.org Subject: RE: transaction rollback =20 Spring calls rollback only when a RuntimeException is encountered. Normal exceptions cause commits (unless stated otherwise in @Transactional tag). This may be the cause of your problem. =20 If this is not the case, what database are you using? And can you send your spring.xml file? =20 Christian =20 ________________________________ From: bharathi.mani@accenture.com [mailto:bharathi.mani@accenture.com]=20 Sent: Wednesday, 04 July 2007 01:36 To: user-java@ibatis.apache.org Subject: transaction rollback Hi,=20 I am using Spring and iBatis. I am trying to make an object transactional by marking the object @transactional using annotational transaction management of Spring. But on doing this no rollback seems to happen if the object throws an exception. And also from logs I find that each SQL statement in iBatis is getting committed as its executed. As a result, no rollback happens when there is any exception. Any help on this will be great. =20 Thanks, Bharathi This message is for the designated recipient only and may contain privileged, proprietary, or otherwise private information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the email by you is prohibited. This message is for the designated recipient only and may contain = privileged, proprietary, or otherwise private information. If you have = received it in error, please notify the sender immediately and delete = the original. Any other use of the email by you is prohibited. ------_=_NextPart_001_01C7BE47.252DD717 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

I find that each operation on the = object gets committed as and when it is executed. For example, I have defined a = method insert in service layer. I have made the service class transactional. = When I invoke the insert method on the object in a while loop, for each iteration, the statement is getting committed.

 

@Transactional

public class PositionManagerImpl = extends BaseManager implements PositionManager {

      = ;      private PositionDao positionDao;

 

=

      = ;      /**

      = ;       * Set the Dao for communication with the data = layer.

      = ;       *

      = ;       * @param dao

      = ;       */

      = ;      public void setPositionDao(PositionDao dao) {

      = ;            =       this.positionDao =3D dao;

      = ;      }

 

=

      = ;      /**

      = ;       * @see com.calyon.foursight.soa.service.PositionManager#getPositions(com.calyon.= foursight.soa.model.Position)

      = ;       */

      = ;      public List getPositions(Position position) {

 

=

      = ;            =       return positionDao.getPositions(position);

      = ;      }

 

=

      = ;      /**

      = ;       * @see = com.calyon.foursight.soa.service.PositionManager#addPositions(HashMap

      = ;       *      map)

      = ;       */

      = ;      public void addPositions(HashMap map) {

      = ;            =       = positionDao.addPositions(map);

      = ;      }

}

I am using Oracle = database.

 

The config file im using = is:

<bean id=3D"transactionManager" class=3D"org.springframework.jdbc.datasource.DataSourceTran= sactionManager">

        = <property name=3D"dataSource" ref=3D"dataSource"/>

    </bean>

  =     <tx:annotation-driven = transaction-manager=3D" transactionManager"/>

 

    <!-- = SqlMap setup for = iBATIS Database Layer = -->

    <bean = id=3D"sqlMapClient" class=3D"org.springframework.orm.ibatis.SqlMapClientFactory= Bean">

        = <property name=3D"configLocation">

          =   <value>classpath:/com/calyon/foursight/soa/dao/ibatis/sql-map-= config.xml</value>

        = </property>

        = <property name=3D"dataSource" ref=3D"dataSource"/>

    </bean>

 

<bean id=3D" positionDao" class=3D"x.y.ibatis.positionDaoiBatis" = autowire=3D"byName"/>

<bean = id=3D"positionManager" class=3D" x.y.impl.position ManagerImpl">

        = <property name=3D" positionDao" ref=3D" positionDao"/>

 </bean>

 


From: = Poitras Christian [mailto:Christian.Poitras@ircm.qc.ca]
Sent: Wednesday, July 04, = 2007 6:59 PM
To: = user-java@ibatis.apache.org
Subject: RE: transaction = rollback

 

Spring calls rollback only when a RuntimeException is encountered. Normal exceptions cause commits (unless = stated otherwise in = @Transactional tag).

This may be the cause of your = problem.

 

If this is not the case, what = database are you using? And can you send your spring.xml = file?

 

Christian

 


From: bharathi.mani@accenture.com [mailto:bharathi.mani@accenture.com]
Sent: Wednesday, 04 July = 2007 01:36
To: = user-java@ibatis.apache.org
Subject: transaction = rollback

Hi,

I am using Spring and iBatis. I am trying to make an = object transactional by marking the object @transactional using annotational transaction management of Spring. But on doing this no rollback seems to = happen if the object throws an exception. And also from logs I find that each = SQL statement in iBatis is getting committed as its executed. As a result, = no rollback happens when there is any exception. Any help on this will be = great.

 

Thanks,

Bharathi

This message is for the designated recipient only and may contain privileged, proprietary, or otherwise private information. If you have received it = in error, please notify the sender immediately and delete the original. Any = other use of the email by you is prohibited.

This message is for the designated = recipient only and may contain privileged, proprietary, or otherwise = private information. If you have received it in error, please notify the = sender immediately and delete the original. Any other use of the email = by you is prohibited.

------_=_NextPart_001_01C7BE47.252DD717--