Yah cool.  You could do that.  You would want to commit the transaction.

Seeing the way you code i am sure you have considered this, but one question

So all these must be under one transaction and in batch mode.  So, even if one 
fails you want all
to fail(not commit).  Is that the business requirement?

Rgds

Prashanth Sukumaran.

--- Hycel Taylor <[EMAIL PROTECTED]> wrote:

> I want to make sure I'm understanding how to use iBatis batching correctly.
> 
> I understand now that SqlMapDaoTemplate, contains the method,
> startBatch() and execute batch.  My Dao will extend SqlMapBaseDao
> which extends SqlMapDaoTemplate.
> 
> So, since my Dao's are sharing the same daoManager, if I startBatch()
> on each dao, do some work, and then executeBatch() on each dao, the
> set of Dao's will be considered to be apart of the same batch?
> 
> Example: 
> 
> try {
>     daoManager.startTransaction();
> 
>     SqlMapSchoolDao schoolDao = new SqlMapSchoolDao(daoManager);
>     SqlMapMajorDao majorDao = new SqlMapMajorDao(daoManager);
>     SqlMapCourseDao courseDao = new SqlMapCourseDao(daoManager);
>     
>     schoolDao.startBatch();
>     majorDao.startBatch();
>     courseDao.startBatch();
>     
>     // Do some iterative tasks.
>     
>     schoolDao.executeBatch();
>     majorDao.executeBatch();
>     courseDao.executeBatch();
> 
>   } catch (Exception e) {
>     throw new ServiceException(e.getMessage());
>   } finally {
>     daoManager.endTransaction();
>   }
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Reply via email to