Hi Daniele,

  We don't have any method in session for rollback.

Regards
 yuvrajs

-----Original Message-----
From: Daniele Cremonini [mailto:[EMAIL PROTECTED] 
Sent: Friday, January 19, 2007 3:43 PM
To: user-java@ibatis.apache.org
Subject: Re: Autocommit not properly handled in Ibatis.

You should put a rollback instruction in the catch section.

Daniele

Yuvraj Shinde wrote:
>
>       public void saveAllRecords( String id, List recordList )
>       {
>               try
>               {
>               getSession().startTransaction();
>                       if (!recordList.isEmpty())
>                       {
>                               for (int i = 0; i < recordList.size();
> i++)
>
>                               {
>                            BasicDTO basicDTO = (BasicDTO)
> recordList.get(i);
>                                  getSession().insert(id +"_INSERT",
> basicDTO);
>                               }
>                               
>                       }
>               getSession().commitTransaction();
>                       
>               }
>               catch (SQLException e)
>               {
>                       throw new RuntimeException("Error while
> Excecuting Batch"                             + e);
>               }
>               finally
>               {
>                       try
>                       {
>                          getSession().endTransaction();
>                       }
>                       catch (SQLException e)
>                       {
>                               throw new RuntimeException("Error while
> Excecuting                            Batch" + e);
>                               
>                       }
>               }
>               
>       }
>
>   


Reply via email to